我试图学习如何调试静态库,我试图解决特别是JsonCpp。如何修复静态库?
我可以使用什么项目设置来查看Visual Studio中输出窗口中的确切链接?
============================================== ====================================
下面是我收到的错误:
Error 1 error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" ([email protected]@@[email protected]) already defined in libcpmtd.lib(xlock.obj) msvcprtd.lib
Error 2 error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" ([email protected]@@[email protected]@Z) already defined in libcpmtd.lib(xlock.obj) msvcprtd.lib
Error 3 error LNK2005: "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" ([email protected]@@[email protected]) already defined in libcpmtd.lib(stdthrow.obj) msvcprtd.lib
Error 4 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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) already defined in Core.obj msvcprtd.lib
Error 5 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> >(char const *)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) already defined in Core.obj msvcprtd.lib
Error 6 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<char,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 Core.obj msvcprtd.lib
Error 7 error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " ([email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@QBEPBDXZ) already defined in Core.obj msvcprtd.lib
Error 8 error LNK2005: "public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " ([email protected][email protected]@@QBEXXZ) already defined in Core.obj msvcprtd.lib
Error 9 error LNK2005: "public: __thiscall std::_Container_base_secure::~_Container_base_secure(void)" ([email protected]@@[email protected]) already defined in Core.obj msvcprtd.lib
Error 10 error LNK2005: "public: __thiscall std::_Container_base_secure::_Container_base_secure(void)" ([email protected]@@[email protected]) already defined in Core.obj msvcprtd.lib
Error 11 error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char const *)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) already defined in libcpmtd.lib(locale0.obj) msvcprtd.lib
Error 12 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> >(unsigned int,char)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) already defined in Serialization.obj msvcprtd.lib
Error 13 error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::size(void)const " ([email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@QBEIXZ) already defined in Core.obj msvcprtd.lib
Error 14 error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in Serialization.obj msvcprtd.lib
Error 15 error LNK2005: "public: static bool __cdecl std::char_traits<char>::eq_int_type(int const &,int const &)" ([email protected][email protected]@[email protected]@[email protected]) already defined in Serialization.obj msvcprtd.lib
Error 16 error LNK2005: "public: static int __cdecl std::char_traits<char>::eof(void)" ([email protected][email protected]@[email protected]@SAHXZ) already defined in Serialization.obj msvcprtd.lib
Error 17 error LNK2005: "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" ([email protected][email protected]@[email protected]@[email protected]) already defined in Core.obj msvcprtd.lib
Error 18 error LNK2005: _malloc already defined in LIBCMTD.lib(dbgmalloc.obj) MSVCRTD.lib
Error 19 error LNK2005: _free already defined in LIBCMTD.lib(dbgfree.obj) MSVCRTD.lib
Error 20 error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" ([email protected]@@[email protected]) already defined in LIBCMTD.lib(stdexcpt.obj) MSVCRTD.lib
Error 21 error LNK2005: "public: __thiscall std::exception::exception(void)" ([email protected]@@[email protected]) already defined in LIBCMTD.lib(stdexcpt.obj) MSVCRTD.lib
Error 22 error LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" ([email protected]@@[email protected]@@Z) already defined in LIBCMTD.lib(stdexcpt.obj) MSVCRTD.lib
Error 23 error LNK2005: _strchr already defined in LIBCMTD.lib(strchr.obj) MSVCRTD.lib
Error 24 error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj) MSVCRTD.lib
Error 25 error LNK2005: __CrtDbgReportW already defined in LIBCMTD.lib(dbgrptw.obj)
MSVCRTD.lib
Error 26 error LNK2005: "public: __thiscall std::exception::exception(char const * const &)" ([email protected]@@[email protected]@Z) already defined in LIBCMTD.lib(stdexcpt.obj) MSVCRTD.lib
Error 27 error LNK2005: _memmove_s already defined in LIBCMTD.lib(memmove_s.obj) MSVCRTD.lib
Error 28 error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj) MSVCRTD.lib
Error 29 error LNK2005: _sprintf_s already defined in LIBCMTD.lib(sprintf.obj) MSVCRTD.lib
Error 30 error LNK2005: _strpbrk already defined in LIBCMTD.lib(strpbrk.obj) MSVCRTD.lib
Error 31 error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" ([email protected]@[email protected]@@Z) already defined in LIBCMTD.lib(typinfo.obj) MSVCRTD.lib
Error 32 error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" ([email protected]@[email protected]@@Z) already defined in LIBCMTD.lib(typinfo.obj) MSVCRTD.lib
Warning 33 warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library Afterfuture Game Engine
Error 34 fatal error LNK1169: one or more multiply defined symbols found C:\Users\Blake\Desktop\Afterfuture\Afterfuture Game Engine\Debug\Afterfuture Game Engine.exe
你问这是什么问题修复这个静态库?我能够修复源代码。 –
然后只编译它以使用您的项目使用的相同标准C库并以相同的方式链接到它。如果您的项目动态链接到多线程发行版标准C库,请重新编译该库以进行相同的链接。 (请参阅我的最后一段的第二句。) –
我真的不知道这是如何回答我的问题的,我非常感谢您的考虑,但我只是在寻找调试用于构建静态库的源代码的方法。 我有两个项目,一个项目是我的主要可执行文件,另一个是我的静态库(正在使用我的可执行项目)。 –