【发布时间】:2009-12-24 08:16:15
【问题描述】:
我正在使用 VC++ 6 开发应用程序。
我有一个第 3 方 DLL。这个库编译为多线程 DLL (/MD) 和我的应用程序。 但我链接失败:
LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO specification
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_strin
g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in XXXApi.lib(CODbg.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<c
har,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in XXXApi.lib(Dictionary.obj)
../../Exes/win2k3_oracle11/XXX.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
从here 我看到,即使第三个库和我的代码都编译为/MD,也可能与正在使用的旧/新iostream 冲突。
有没有办法确定第 3 方库使用的旧/新 iostream 库?
更新: 第 3 方库是静态的,而不是我之前认为的动态。 该库是编译/MD。 Dependency Walker 使用 DLL 而不是哪个 Lib。
【问题讨论】:
标签: c++ dll visual-c++ visual-c++-6