链接错误LNK2005

    技术2022-05-20  35

    原文地址:http://www.cnblogs.com/youyou/archive/2005/09/20/240266.html

     

    libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ ) 已经在 test_smilgen.obj 中定义 libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ ) 已经在 test_smilgen.obj 中定义 LINK : warning LNK4098: 默认库“LIBCMTD”与其他库的使用冲突;使用 /NODEFAULTLIB:library ../../bin/win32/test_smilgen.exe : fatal error LNK1169: 找到一个或多个多重定义的符号 环境:vs2003 ================================ 是由于静态库调用了不同的标注C++库造成的,解决办法:在工程属性中,设置“运行时库 ”对应的Option

    Standard C++ LibraryCharacteristicsOptionPreprocessor directives LIBCP.LIBSingle-threaded, static link/ML  LIBCPMT.LIBMultithreaded, static link/MT _MTMSVCPRT.LIBMultithreaded, dynamic link (import library for MSVCP71.dll)/MD _MT, _DLLLIBCPD.LIBSingle-threaded, static link/MLd _DEBUGLIBCPMTD.LIBMultithreaded, static link/MTd _DEBUG, _MTMSVCPRTD.LIBMultithreaded, dynamic link (import library for MSVCP71D.DLL)/MDd _DEBUG, _MT, _DLL

    最新回复(0)