在VC2008之前 ,如果一个解决方案里面有多个项目A,B,C,其中主工程是C,其中C依赖A,B, 当编译C工程时,IDE会自动在A,B里面寻找符号进行连接。
到了VC2012的时候,哪怕你在依赖项里面,已经把A,B关联了C。编译的时候,会报如下的链接错误。
error LNK2019: unresolved external symbol ...
...
解决问题的步骤如下
- Right click on the App project and select "References..."
- Click "Add New Reference".
- Check the static library project and press OK.
- Build.