验证库中使用的CRT(.lib)

Moh*_*ana 10 c++ windows crt

如何检查Windows中的静态库(.lib)链接到哪个运行时库?

我用/ MDd编译我的项目,我假设我正在链接的库正在使用/ MTd多线程调试

Error   7   error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in libcpmtd.lib(xlock.obj)    C:\...\msvcprtd.lib(MSVCP100D.dll)
Run Code Online (Sandbox Code Playgroud)

LIBCPMTD.LIB =多线程,静态链接

我知道有一个选项/NODEFAULTLIB:"libcpmtd.lib",我已经尝试并成功,但我宁愿避免这种情况.

Moh*_*ana 7

我能够解决这个问题

> dumpbin /DIRECTIVES C:\..\ThirdParty\tidy\windows\lib\libtidy
.lib
Microsoft (R) COFF/PE Dumper Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file C:\..\ThirdParty\tidy\windows\lib\libtidy.lib

File Type: LIBRARY

   Linker Directives
   -----------------
   /DEFAULTLIB:"LIBCMT"
   /DEFAULTLIB:"OLDNAMES"
...
Run Code Online (Sandbox Code Playgroud)

这是与MT的紧密联系.我使用/ MDd重新编译了lib并且链接很好.