解决Error LNK2019: unresolved external symbol

来源:互联网 发布:书法软件哪个最好 编辑:程序博客网 时间:2024/06/05 06:05

解决方案一:

The problem with your project is that you are using a “C” style exported library in your C++ projects. When the compiler generates mangled names for C++ functions, they are different from unmangled names generated by the C compiler and hence the C++ compiler will not be able to link with the methods imported from coredll.lib.

The solution to this problem is – while including the header windbase_edb.h, you can explicitly tell the compiler that all functions included from this header are “C” style functions by changing your inclusion as below.

extern “C”
{
 #include <windbase_edb.h>
}


With this the C++ compiler when includes the declarations from the windbase_edb.h file, it does not do any name mangling for the functions declared in this file, and thus you should be able to link to EDB without any problems now.


解决方案二:

最可能的原因就是lib配置出了问题,到Property->Linker->Input->Additional Dependencies里面查看类库是否配置有错误。

一般都是根据Errorlist里提示的lib文件进行寻找,有时多配了也不行,就是没有用到这个lib你配进去了可能也会出问题之类的...

一般都是少配了,或者debug版本的配成了release的等等。

0 0