当我使用
构建项目时,我在同一个项目中使用chilkat和libcurl运行时库=>多线程DLL(/ MD)
然后我收到这些错误并发出警告:
Error 4 error LNK1169: one or more multiply defined symbols found
Error 1 error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR90.dll)
Error 2 error LNK2005: __strdup already defined in LIBCMT.lib(strdup.obj)
Warning 3 warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
以及使用
构建时运行时库=>多线程(/ MT)
Error 54 error LNK1169: one or more multiply defined symbols found
Error 44 error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
Error 45 error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
Error 11 error LNK2005: ___iob_func already defined in LIBCMT.lib(_file.obj)
Error 39 error LNK2005: __beginthreadex already defined in LIBCMT.lib(threadex.obj)
Error 47 error LNK2005: __close already defined in LIBCMT.lib(close.obj)
...
答案 0 :(得分:0)
Chilkat提供“多线程DLL”和“多线程”(即静态)库。确保链接ChilkatRelDll.lib而不是ChilkatRel.lib
由于在多线程DLL运行时项目中链接ChilkatRel.lib而发生此错误,该项目多次出现相同的lib文件,这发生了多个函数定义。这些符号出现在libcmt.lib
中您可以使用运行时库作为多线程DLL(/ MD)和来解决此问题 将“libcmt.lib”添加到“忽略特定库”字段不会让我解决此问题。
答案 1 :(得分:0)
Chilkat提供"多线程DLL"和"多线程" (即静态)库。确保链接ChilkatRelDll.lib而不是ChilkatRel.lib