Hey, i'm just starting a Visual C++ 2005 project that needs to parse Json data, so jsoncpp seems like a nice library for it. unfortunately whenever I try to build the simple test project it fails during link like this:
2>Linking...
2>msvcprtd.lib(MSVCP80D.dll) : 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)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in json_vc71_libmtd.lib(json_reader.obj)
2>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::_Container_base::~_Container_base(void)" (??1_Container_base@std@@QAE@XZ) already defined in json_vc71_libmtd.lib(json_reader.obj)
2>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
2>C:\Documents and Settings\josh\Desktop\Josh\json_win32test\Debug\json_win32test.exe : fatal error LNK1169: one or more multiply defined symbols found
I'm sort of at a loss as to how to get it to link, any suggestions?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
found it. How frustrating that was to find, you have to make sure that all the libraries in your solution are set to the same "Runtime Library" option in project properties->c/c++->code generation->runtime library
in this case, lib_json was set to:
Multi-threaded Debug (/MTd)
and the rest of the solution was:
Multi-threaded Debug DLL (/MDd)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey, i'm just starting a Visual C++ 2005 project that needs to parse Json data, so jsoncpp seems like a nice library for it. unfortunately whenever I try to build the simple test project it fails during link like this:
2>Linking...
2>msvcprtd.lib(MSVCP80D.dll) : 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)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in json_vc71_libmtd.lib(json_reader.obj)
2>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::_Container_base::~_Container_base(void)" (??1_Container_base@std@@QAE@XZ) already defined in json_vc71_libmtd.lib(json_reader.obj)
2>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
2>C:\Documents and Settings\josh\Desktop\Josh\json_win32test\Debug\json_win32test.exe : fatal error LNK1169: one or more multiply defined symbols found
I'm sort of at a loss as to how to get it to link, any suggestions?
found it. How frustrating that was to find, you have to make sure that all the libraries in your solution are set to the same "Runtime Library" option in project properties->c/c++->code generation->runtime library
in this case, lib_json was set to:
Multi-threaded Debug (/MTd)
and the rest of the solution was:
Multi-threaded Debug DLL (/MDd)