c++ 静态链接库无法正常引用
今天使用 c++ 的一个静态链接库,按照相应的步骤填写了相应的静态链接库配置:
- On Property Pages, go to C/C++ ->General -> Additional Include Directories
- Then go to Linker->General->Additional Library Directories and specify the path, where your .lib file is located.
- Finally, go to Linker->Input->Additional Dependencies and add the name of the file containing your library together with its extension (e.g. example_library.lib).
但是配置完还是发现不能用。
最后通过 对比原lib工程和现有工程的属性页,发现他们使用的字符集不一样。
自己的工程使用的是unicode字符集,而原项目使用的多字节字符集,结果改过来就可以用了。
记录一下,下次 c++ 碰到这种报错不明确的问题,好有个思路。