A bunch of errors appeared in VS2012 C++ compilation today:
1 1 > Code generation... 2 1 >Code.obj: error LNK2005: " public: __thiscall std::_Container_base12::_Container_base12(void) " (?? 0_Container_base12@std@@QAE@XZ) is already in msvcprtd. Defined in lib(MSVCP110D.dll) 3 1 >Code.obj: error LNK2005: " public: __thiscall std::_Container_base12::~_Container_base12(void) " (?? 1_Container_base12@std@@QAE@XZ) is already in msvcprtd. Defined in lib(MSVCP110D.dll) 4 1 >Code.obj: error LNK2005: " public: void __thiscall std::_Container_base12::_Orphan_all(void) " (?_Orphan_all@_Container_base12@std@@QAEXXZ) has been defined in msvcprtd.lib(MSVCP110D.dll) 5 1 > IOCP_Socket.lib(CLog.obj): error LNK2038: mismatch detected for "RuntimeLibrary": value "MDd_DynamicDebug" Mismatched value "MTd_StaticDebug" (in Code.obj) 6 1 > IOCP_Socket.lib(TcpServer.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (Code. obj) 7 1 > IOCP_Socket.lib(stdafx.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (Code.obj) 8 1 > IOCP_Socket.lib (TcpSrvException.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (in Code.obj) 9 1> IOCP_Socket.lib(TcpReceiveContext.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (in Code.obj) 10 1 > IOCP_Socket.lib(TcpSendContext.obj) : error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (Code.obj) 11 1 > IOCP_Socket.lib(AcceptContext.obj): error LNK2038: "RuntimeLibrary" detected Mismatch for: value "MDd_DynamicDebug" does not match value "MTd_StaticDebug" (in Code.obj) 12 1 > IOCP_Socket.lib(OperateContext.obj): error LNK2038: mismatch detected for "RuntimeLibrary": value "MDd_DynamicDebug" Does not match the value "MTd_StaticDebug" (in Code.obj) 13 1 >IOCP_Socket.lib(MemoryBlock.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (in Code.obj) 14 1 > IOCP_Socket.lib(ContextStack.obj): error LNK2038: mismatch detected for "RuntimeLibrary": The value "MDd_DynamicDebug" does not match the value "MTd_StaticDebug" (in Code.obj) 15 1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " void __cdecl std:: _Debug_message(wchar_t const *,wchar_t const *,unsigned int) " (? _Debug_message@std@@YAXPB_W0I@Z) has been defined in libcpmtd.lib(stdthrow.obj) 16 1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " public: __thiscall std::_Container_base12::_Container_base12(void) " (??0_Container_base12@std@@QAE@XZ) has been defined in Code.obj 17 1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " public: __thiscall std::_Container_base12::~_Container_base12(void) " (?? 1_Container_base12@std@@QAE@XZ) has been defined in Code.obj 18 1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " public: void __thiscall std::_Container_base12::_Orphan_all(void) " (? _Orphan_all @_Container_base12@std@@QAEXXZ) has been defined in Code.obj 19 1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " void __cdecl std::_Xbad_alloc(void) " (?_Xbad_alloc@std@@YAXXZ) has been defined in libcpmtd.lib(xthrow.obj) 20 1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " void __cdecl std::_Xlength_error(char const *) " (? _Xlength_error @std@@YAXPBD@Z) has been defined in libcpmtd.lib(xthrow.obj) 21 1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " void __cdecl std::_Xout_of_range(char const *) " (? _Xout_of_range@std@@YAXPBD@Z) has been defined in libcpmtd.lib(xthrow.obj) 22 1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " char const * __cdecl std::_Syserror_map(int) " ( ?_Syserror_map@std@@YAPBDH@Z) has been defined in libcpmtd.lib(syserror.obj) 23 1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " char const * __cdecl std::_Winerror_map(int) " ( ? _Winerror_map@std@@YAPBDH@Z) has been defined in libcpmtd.lib(syserror.obj) 24 1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " public: __thiscall std::_Lockit::_Lockit(int ) " (?? 0_Lockit@std@@QAE@H@Z) has been defined in libcpmtd.lib(xlock.obj) 25 1 >msvcprtd.lib(MSVCP110D.dll): error LNK2005: " public: __thiscall std:: _Lockit::~_Lockit(void) " (??1_Lockit@std@@QAE@XZ) is already defined in libcpmtd.lib(xlock.obj) 26 1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _memmove is already defined in LIBCMTD.lib(memmove.obj) 27 1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj) 28 1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _fflush already defined in LIBCMTD.lib(fflush .obj) 29 1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _printf already defined in LIBCMTD.lib(printf.obj) 30 1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _vprintf already defined Defined in LIBCMTD.lib(vprintf.obj) 31 1 >MSVCRTD.lib(MSVCR110D.dll): error LNK2005: __vsnprintf_s already defined in LIBCMTD.lib(vsnprnc.obj) 32 1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _vsprintf_s already defined in LIBCMTD.lib(vsnprnc.lib(vsnprnc) ) Defined in 33 1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: __invalid_parameter is already defined in LIBCMTD.lib(invarg.obj) 34 1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _memcpy_s is already defined in LIBCMTD .lib(memcpy_s.obj) is defined in 35 1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: _strncpy_s is already defined in LIBCMTD.lib(strncpy_s.obj) 36 1 >MSVCRTD.lib(MSVCR110D.dll): error LNK2005: "public: virtual __thiscall std::exception::~exception(void) " (?? 1exception@std@@UAE@XZ) has been defined in LIBCMTD.lib(stdexcpt.obj) 37 1 >MSVCRTD.lib(MSVCR110D.dll ): error LNK2005: " public: virtual char const * __thiscall std::exception::what(void)const " (? what@exception@std@@UBEPBDXZ) is already defined in LIBCMTD.lib(stdexcpt.obj) 38 1 > MSVCRTD.lib(MSVCR110D.dll): error LNK2005: __CrtDbgReportW is already defined in LIBCMTD.lib(dbgrptw.obj) 39 1 >MSVCRTD.lib(ti_inst.obj): error LNK2005: " private: __thiscall type_info::type_info( class type_info const &) " (??0type_info@@AAE@ABV0@@Z) is already defined in LIBCMTD.lib(typinfo.obj) 40 1 >MSVCRTD.lib(ti_inst.obj): error LNK2005: " private: class type_info & __thiscall type_info::operator=( class type_info const &) " (?? 4type_info@@AAEAAV0@ABV0@@Z) has been defined in LIBCMTD.lib(typinfo.obj) 41 1 >LINK: warning LNK4098: The default library "MSVCRTD" conflicts with the use of other libraries ;Please use / NODEFAULTLIB:library 42 1 >E:\Projects\C++ \IOCP_Socket\Debug\Test.exe: fatal error LNK1169: Found one or more multiple defined symbols 43 ========== Generate : Success 0 , failure 1 , 0 latest , skip 0 ==========
Later, I checked it and found that it was a problem with the runtime library settings; the runtime library settings for several projects were different:
Project Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library
We are set on the line, like multi-threaded debugging (/ MTd)
Read More:
- Error lnk2038: detected “_ ITERATOR_ DEBUG_ Mismatched ‘level’ value of ‘0’
- No match for ‘operator =’ both ends of the equal sign do not match
- [Solved] Visual studio 2022 error LNK2019: unable to resolve external symbol for
- error LNK2019: Unresolvable external symbols “__declspec(dllimport) public: int __thiscall QString::toWCharArray(wchar_t
- [system] [error] Attempted to start Color camera – NOT detected
- Oracle prompt text does not match format string
- [Solved] JNI DETECTED ERROR IN APPLICATION: GetStringUTFChars received NULL jstring
- [Solved] Canal Error: CanalParseException: column size is not match,parse row data failed
- [Solved] Eureka Startup Error: Root name (‘timestamp‘) does not match expected type EurekaApplications
- [Solved] Error: SRC refspec master doors not match any
- error: src refspec master does not match any [How to Solve]
- [Solved] MindSpore Error: ValueError: Minimum inputs size 0 does not match…
- error: src refspec master does not match any. [How to Solve]
- error: src refspec master does not match any [How to Solve]
- CUDA_ERROR_SYSTEM_DRIVER_MISMATCH [How to Solve]
- [Solved] paddle:FatalError: `Segmentation fault` is detected by the operating system.
- Solve error LNK2001 about pcl::io::vtkPolyDataToPointCloud
- How to Solve Error: Type mismatch: cannot convert from Object to Car
- [Solved] QT cmak Compile Error: CMake Error: The source.. does not match the soused
- [Solved] Camera Calibration Error: ErrorMessage: Image size does not match the measurement in camera parameters