2009-12-24 48 views
2

我正在开发应用程序使用VC++ 6.新手:确定库使用的CRT库

我有一个第三方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 
[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 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 &)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@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我看到,即使两个3库和我的代码编译成/ MD,有可能与使用的新/旧的iostream北宁市冲突。

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

UPD: 第三方库是静态的,不像我之前想的那样是动态的。 lib被编译/ MD。依赖Walker工作wirh DLL而不是哪个Libs。

回答

2

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

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

如果你想链接到第三方DLL,你只需要为该DLL制作一个.lib文件。 如果你没有那个.lib,你可以使用pelle c工具中的lib.exe或polib.exe。 polib更容易使用,因为您不需要编写一个.def文件。 http://www.smorgasbordet.com/pellesc/

我希望它对你的问题有帮助。

编辑:你有你正在使用的.lib的源代码吗?