LNK2005

来源:互联网 发布:淘宝铁三角店铺推荐 编辑:程序博客网 时间:2024/05/22 05:18

这个问题在编译Detours时遇到两次了,总结下:

显示为:

1.MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)2.MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)3.LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library4..\Debug/project.exe : fatal error LNK1169: one or more multiply defined symbols found


原因很简单,就是把C/C++-->Code Generation-->Runtime Library改为一致就OK了 

关于编译选项所对应的链接库,可以参考msdn以下连接:

 http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx

原创粉丝点击