我正在开发使用应用VC ++ 6.

我有一个第三方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.

我看到,即使两个3库和我的代码编译成/ MD rel="nofollow noreferrer">这里,有可能与使用的新/旧的iostream北宁市冲突。

有没有办法确定的什么iostream库旧/新所使用的第三方库?

<强> UPD: 第三方的lib是静态的,因为我原来想象的不动。 的lib编译/ MD。 Dependency Walker中工作wirh的DLL,而不是哪个库。

有帮助吗?

解决方案

有是的Dependency Walker,如果你不知道这个工具。 http://dependencywalker.com/

拖放在主窗口中的DLL或EXE。它会显示所有的依赖关系。

如果你要链接到第三方的DLL,所有你需要的是该DLL做了的.lib。 如果没有那个的.lib,您可以使用LIB.EXE或polib.exe从pellesÇ工具总是一个。 polib更容易使用,因为你并不需要写一个DEF文件。 http://www.smorgasbordet.com/pellesc/

我希望它可以帮助你的问题。

编辑:你有你所使用的的.lib的源代码

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top