MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z) already defined in LIBCD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: "public: __thiscall exception::exception(char const * const &)" (??0exception@@QAE@ABQBD@Z) already defined in LIBCD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) already defined in LIBCD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: "public: __thiscall exception::exception(void)" (??0exception@@QAE@XZ) already defined in LIBCD.lib(stdexcpt.obj)
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/ThreadPool.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
ThreadPool.exe - 5 error(s), 8 warning(s)
原因及解决办法
主程序和lib所使用的运行库不一致,
project->setting-> Generation->Use MFC in a Shared DLL,
重新编译,成功通过。