关于c ++:使用Boost在Visual Studio10上编译和使用JSONCPP

Compiling and Using JSONCPP on Visual Studio10 with Boost

我最近使用vs71 makefiles编译了jsoncpp的SVN版本。它起作用了,但我有很多链接器错误

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
1>msvcprt.lib(MSVCP100.dll) : error LNK2005:"public: __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,__int64)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z) 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)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@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" (?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) 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)" (?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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)" (??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ) 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)" (??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z) 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)" (??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ) 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" (?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@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)" (?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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 *)" (?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z) 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 *)" (?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z) 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)" (?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z) 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)" (?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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" (?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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 *)" (?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z) 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)" (?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z) 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" (?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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" (?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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" (?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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" (?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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" (?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) 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)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) 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)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@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)" (??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ) 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" (?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ) 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)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) 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)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ) 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 &)" (?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@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)" (?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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)" (?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PAD_J@Z) 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)" (?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE_JPBD_J@Z) 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)" (?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE_JPAD_J@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> >::uflow(void)" (?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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)" (?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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)" (?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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)" (?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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)" (??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in JSONCPP.lib(json_writer.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005:"public: __int64 __thiscall std::ios_base::width(__int64)" (?width@ios_base@std@@QAE_J_J@Z) already defined in JSONCPP.lib(json_writer.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005:"public: __int64 __thiscall std::ios_base::width(void)const" (?width@ios_base@std@@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" (?flags@ios_base@std@@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" (?good@ios_base@std@@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" (?rdstate@ios_base@std@@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)" (?_Decref@facet@locale@std@@QAEPAV123@XZ) already defined in JSONCPP.lib(json_writer.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005:"public: void __thiscall std::locale::facet::_Incref(void)" (?_Incref@facet@locale@std@@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)" (??Bid@locale@std@@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)" (?_Orphan_all@_Container_base12@std@@QAEXXZ) already defined in JSONCPP.lib(json_reader.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005:"public: __thiscall std::_Container_base12::~_Container_base12(void)" (??1_Container_base12@std@@QAE@XZ) already defined in JSONCPP.lib(json_reader.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005:"public: void __thiscall std::_Container_base0::_Orphan_all(void)" (?_Orphan_all@_Container_base0@std@@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)" (?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z) 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)" (?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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)" (?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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" (?getloc@ios_base@std@@QBE?AVlocale@2@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 *)" (?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@PBV42@@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" (?is@?$ctype@D@std@@QBE_NFD@Z) 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 *)" (?_Addstd@ios_base@std@@SAXPAV12@@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 *)" (?_Ios_base_dtor@ios_base@std@@CAXPAV12@@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 *)" (?_Facet_Register@facet@locale@std@@CAXPAV123@@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)" (?_Getgloballocale@locale@std@@CAPAV_Locimp@12@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 *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@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 *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@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)" (?_Init@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprt.lib(MSVCP100.dll)
1>libcpmt.lib(xlock.obj) : error LNK2005:"public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in msvcprt.lib(MSVCP100.dll)
1>libcpmt.lib(xlock.obj) : error LNK2005:"public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) 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)" (?terminate@@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)" (?_type_info_dtor_internal_method@type_info@@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 &)" (??0type_info@@AAE@ABV0@@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 &)" (??4type_info@@AAEAAV0@ABV0@@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_数组与它一起使用,但是当我定义迭代器_debug_level 0时,它会与jsoncpp的_迭代器_debug_level 2冲突(需要这样才能使boost::multi_数组调整大小工作)。我该如何解决这个问题?


所有的错误都表明您的构建中存在错误的C运行时设置。确保所有对象文件、库等都使用相同的运行时设置进行编译,即:

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

如果所有项目的此设置不同,则违反了一个定义规则(因为每个C运行时定义的内容都不同),这将导致您看到的行为。

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

您可以通过在VisualStudio中通过选择项目的项目属性、转到C/C++>代码生成以及更改运行时下拉框来更改此设置。