2011-02-07 83 views
14

我最近使用VS71 makefiles编译了JSONCPP的SVN版本。它的工作,但我得到了很多的链接错误的在Visual Studio10上编译和使用JSONCPP和Boost

 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,__int64)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@QAEXXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected]@[email protected]@@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Init(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@IAEXXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::basic_streambuf<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::basic_ostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected][email protected]@[email protected]@@[email protected][email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: __thiscall std::basic_ios<char,struct std::char_traits<char> >::basic_ios<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: char __thiscall std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@QBEDXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Pninc(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@IAEPADXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::setp(char *,char *,char *)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::setp(char *,char *)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::pbump(int)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Gninc(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@IAEPADXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::epptr(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IBEPADXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::setg(char *,char *,char *)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::gbump(int)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::egptr(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IBEPADXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::pptr(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IBEPADXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::pbase(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IBEPADXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::gptr(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IBEPADXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::eback(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IBEPADXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@QAEAAV1[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]@Z) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __thiscall std::basic_ostream<char,struct std::char_traits<char> >::~basic_ostream<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected]@[email protected]@@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : 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 JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __thiscall std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: virtual void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::imbue(class std::locale const &)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]@@Z) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: virtual int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sync(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@MAEHXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: virtual class std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::setbuf(char *,__int64)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: virtual __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::xsputn(char const *,__int64)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: virtual __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::xsgetn(char *,__int64)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: virtual int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::uflow(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@MAEHXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: virtual __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::showmanyc(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@MAE_JXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@UAEXXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@UAEXXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::~basic_streambuf<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __int64 __thiscall std::ios_base::width(__int64)" ([email protected][email protected]@@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __int64 __thiscall std::ios_base::width(void)const " ([email protected][email protected]@@QBE_JXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __thiscall std::ios_base::flags(void)const " ([email protected][email protected]@@QBEHXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: bool __thiscall std::ios_base::good(void)const " ([email protected][email protected]@@QBE_NXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __thiscall std::ios_base::rdstate(void)const " ([email protected][email protected]@@QBEHXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::locale::facet * __thiscall std::locale::facet::_Decref(void)" ([email protected]@[email protected]@@[email protected]) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::locale::facet::_Incref(void)" ([email protected]@[email protected]@@QAEXXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::locale::id::operator unsigned int(void)" ([email protected]@[email protected]@QAEIXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::_Container_base12::_Orphan_all(void)" ([email protected][email protected]@@QAEXXZ) already defined in JSONCPP.lib(json_reader.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::_Container_base12::~_Container_base12(void)" ([email protected]@@[email protected]) already defined in JSONCPP.lib(json_reader.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::_Container_base0::_Orphan_all(void)" ([email protected][email protected]@@QAEXXZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: bool __thiscall std::basic_istream<char,struct std::char_traits<char> >::_Ipfx(bool)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in JSONCPP.lib(json_reader.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::snextc(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@QAEHXZ) already defined in JSONCPP.lib(json_reader.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sgetc(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@QAEHXZ) already defined in JSONCPP.lib(json_reader.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::locale __thiscall std::ios_base::getloc(void)const " ([email protected][email protected]@@[email protected]@XZ) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: static unsigned int __cdecl std::ctype<char>::_Getcat(class std::locale::facet const * *,class std::locale const *)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@@Z) already defined in JSONCPP.lib(json_writer.obj) 
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: bool __thiscall std::ctype<char>::is(short,char)const " ([email protected][email protected]@[email protected]@[email protected]) already defined in JSONCPP.lib(json_reader.obj) 
1>libcpmt.lib(ios.obj) : error LNK2005: "public: static void __cdecl std::ios_base::_Addstd(class std::ios_base *)" ([email protected][email protected]@@[email protected]@Z) already defined in msvcprt.lib(MSVCP100.dll) 
1>libcpmt.lib(ios.obj) : error LNK2005: "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" ([email protected][email protected]@@[email protected]@Z) already defined in msvcprt.lib(MSVCP100.dll) 
1>libcpmt.lib(locale0.obj) : error LNK2005: "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)" ([email protected]@[email protected]@@[email protected]@Z) already defined in msvcprt.lib(locale0_implib.obj) 
1>libcpmt.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" ([email protected]@[email protected]@[email protected]@XZ) already defined in msvcprt.lib(MSVCP100.dll) 
1>libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" ([email protected][email protected]@@[email protected]@Z) already defined in msvcprt.lib(MSVCP100.dll) 
1>libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" ([email protected][email protected]@@[email protected]@Z) already defined in msvcprt.lib(MSVCP100.dll) 
1>libcpmt.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" ([email protected]@[email protected]@[email protected]@XZ) already defined in msvcprt.lib(MSVCP100.dll) 
1>libcpmt.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" ([email protected]@@[email protected]@Z) already defined in msvcprt.lib(MSVCP100.dll) 
1>libcpmt.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" ([email protected]@@[email protected]) already defined in msvcprt.lib(MSVCP100.dll) 
1>LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" ([email protected]@YAXXZ) already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(lconv.obj) : error LNK2005: _localeconv already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(typinfo.obj) : error LNK2005: "public: void __thiscall type_info::_type_info_dtor_internal_method(void)" ([email protected][email protected]@QAEXXZ) already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(typinfo.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" ([email protected]@[email protected]@@Z) already defined in MSVCRT.lib(ti_inst.obj) 
1>LIBCMT.lib(typinfo.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" ([email protected]@[email protected]@@Z) already defined in MSVCRT.lib(ti_inst.obj) 
1>LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR100.dll) 
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj) 
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj) 
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj) 
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj) 
1>LIBCMT.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in MSVCRT.lib(crtexe.obj) 
1>LIBCMT.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR100.dll) 
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library 
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library 

而且,我需要使用boost :: multi_array的它,但是当我#定义_ITERATOR_DEBUG_LEVEL 0,它JSONCPP的_ITERATOR_DEBUG_LEVEL 2冲突(需要这个升压:: multi_array调整大小以工作)。我将如何解决这个问题?

+0

'boost :: multi_array`中的resize方法不需要'_ITERATOR_DEBUG_LEVEL 0'。如果你需要这个定义,那么你正在做一些调用未定义行为的东西(并且迭代器调试显示你有未定义的行为)。 – 2011-02-07 04:17:49

+0

我需要使用它,因为VC2010会调整大小。这是一个线程http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/3c9eac4f-86e4-490b-bbde-dbd70176b0f8。 – Yelnats 2011-02-07 23:00:33

回答

25

所有的错误都指示你的版本有错误C runtime settings。请确保您所有的目标文件,库等使用相同的运行时环境编译的,那就是:

  • 多线程(/MT
  • 多线程DLL(/MD
  • 多线程调试(/MTd
  • 多线程调试DLL(/MDd

如果此设置是不是所有的项目一样,你violat编辑一个定义规则(因为每个C运行时定义不同的东西),这会导致你看到的行为。

我的猜测是假设标准库的静态版本(/MT)正在构建JSONCPP库,而您的代码使用的是动态链接版本(/MD)的Visual Studio默认值。

您可以在Visual Studio中更改此设置,方法是选择项目的项目属性,转至C/C++ - >代码生成,然后更改运行时下拉框。