Rapidjson: CMake 3.5.0 creates VS2015 projects that don't build properly

Created on 1 May 2016  ·  1Comment  ·  Source: Tencent/rapidjson

After doing the git submodule init, I usedCMake 3.5.0 in an Windows 7 64bit Command prompt, following the steps on the web site:
D:\GITRepos\rapidjson>cd build

D:\GITRepos\rapidjson\build>cmake ..
-- Building for: Visual Studio 14 2015
-- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found version "1.8.8")
-- Found GTestSrc: D:/GITRepos/rapidjson/thirdparty/gtest
-- Found PythonInterp: C:/cygwin64/bin/python (found version "1.4")
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: D:/GITRepos/rapidjson/build

D:\GITRepos\rapidjson\build>

I then opened VS 2015 and built everything . I got the following:

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
2>------ Build started: Project: gtest, Configuration: Debug Win32 ------
2> gtest.vcxproj -> D:\GITRepos\rapidjson\build\googletest\Debug\gtest.lib
3>------ Build started: Project: doc, Configuration: Debug Win32 ------
4>------ Skipped Build: Project: Continuous, Configuration: Debug Win32 ------
4>Project not selected to build for this solution configuration
5>------ Skipped Build: Project: Experimental, Configuration: Debug Win32 ------
5>Project not selected to build for this solution configuration
6>------ Skipped Build: Project: Nightly, Configuration: Debug Win32 ------
6>Project not selected to build for this solution configuration
7>------ Skipped Build: Project: NightlyMemoryCheck, Configuration: Debug Win32 ------
7>Project not selected to build for this solution configuration
8>------ Build started: Project: gtest_main, Configuration: Debug Win32 ------
9>------ Build started: Project: examples, Configuration: Debug Win32 ------
10>------ Skipped Build: Project: RUN_TESTS, Configuration: Debug Win32 ------
10>Project not selected to build for this solution configuration
11>------ Skipped Build: Project: travis_doc, Configuration: Debug Win32 ------
11>Project not selected to build for this solution configuration
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6001: Invalid command line switch for "cmd.exe". Illegal characters in path.
8> gtest_main.vcxproj -> D:\GITRepos\rapidjson\build\googletest\Debug\gtest_main.lib
12>------ Build started: Project: perftest, Configuration: Debug Win32 ------
13>------ Build started: Project: unittest, Configuration: Debug Win32 ------
12>gtest.lib(gtest-all.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: bool __thiscall std::ios_base::good(void)const " (?good@ios_base@std@@QBE_NXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: int __thiscall std::ios_base::flags(void)const " (?flags@ios_base@std@@QBEHXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __int64 __thiscall std::ios_base::width(void)const " (?width@ios_base@std@@QBE_JXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __int64 __thiscall std::ios_base::width(__int64)" (?width@ios_base@std@@QAE_J_J@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: __thiscall std::basic_streambuf >::basic_streambuf >(void)" (??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: virtual __thiscall std::basic_streambuf >::~basic_streambuf >(void)" (??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __int64 __thiscall std::basic_streambuf >::sputn(char const _,__int64)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::eback(void)const " (?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::gptr(void)const " (?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::pbase(void)const " (?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::pptr(void)const " (?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::egptr(void)const " (?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::gbump(int)" (?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::setg(char ,char *,char *)" (?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::epptr(void)const " (?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::pbump(int)" (?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::setp(char *,char *)" (?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::setp(char *,char *,char *)" (?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::_Pninc(void)" (?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: virtual __thiscall std::basic_ios >::~basic_ios >(void)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: void __thiscall std::basic_ios >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > * __thiscall std::basic_ios >::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 gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_streambuf > * __thiscall std::basic_ios >::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 gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: char __thiscall std::basic_ios >::fill(void)const " (?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: __thiscall std::basic_ios >::basic_ios >(void)" (??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: void __thiscall std::basic_ostream >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::operator<<(unsigned int)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::operator<<(double)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __thiscall std::basic_iostream >::basic_iostream >(class std::basic_streambuf > *)" (??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z) already defined in gtest.lib(gtest-all.obj)
12>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: virtual __thiscall std::basic_iostream >::~basic_iostream >(void)" (??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in gtest.lib(gtest-all.obj)
12>libcpmtd.lib(ios.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.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 msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.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 msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.lib(locale0.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(locale0.obj) : error LNK2005: "void __cdecl std::_Facet_Register(class std::_Facet_base *)" (?_Facet_Register@std@@YAXPAV_Facet_base@1@@Z) already defined in msvcprtd.lib(locale0_implib.obj)
12>libcpmtd.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 msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(bool)" (?_Init@locale@std@@CAPAV_Locimp@12@_N@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.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 msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.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 msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.lib(cerr.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(iosptrs.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(locale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(xlock.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.lib(xthrow.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(xthrow.obj) : error LNK2005: "void __cdecl std::_Xbad_alloc(void)" (?_Xbad_alloc@std@@YAXXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.lib(xthrow.obj) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.lib(xthrow.obj) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.lib(wlocale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(xlocale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(xdateord.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(xwctomb.obj) : error LNK2005: __Getcvt already defined in msvcprtd.lib(MSVCP140D.dll)
12>libcpmtd.lib(winapisupp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(StlCompareStringA.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(winapinls.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(StlCompareStringW.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(StlLCMapStringW.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>libcpmtd.lib(StlLCMapStringA.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in misctest.obj
12>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
13>gtest.lib(gtest-all.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: bool __thiscall std::ios_base::good(void)const " (?good@ios_base@std@@QBE_NXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: int __thiscall std::ios_base::flags(void)const " (?flags@ios_base@std@@QBEHXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __int64 __thiscall std::ios_base::width(void)const " (?width@ios_base@std@@QBE_JXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __int64 __thiscall std::ios_base::width(__int64)" (?width@ios_base@std@@QAE_J_J@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: __thiscall std::basic_streambuf >::basic_streambuf >(void)" (??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: virtual __thiscall std::basic_streambuf >::~basic_streambuf >(void)" (??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __int64 __thiscall std::basic_streambuf >::sputn(char const *,__int64)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::eback(void)const " (?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::gptr(void)const " (?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::pbase(void)const " (?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::pptr(void)const " (?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::egptr(void)const " (?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::gbump(int)" (?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::setg(char *,char *,char *)" (?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::epptr(void)const " (?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::pbump(int)" (?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::setp(char *,char *)" (?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::setp(char *,char *,char *)" (?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::_Pninc(void)" (?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: virtual __thiscall std::basic_ios >::~basic_ios >(void)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: void __thiscall std::basic_ios >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > * __thiscall std::basic_ios >::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 gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_streambuf > * __thiscall std::basic_ios >::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 gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: char __thiscall std::basic_ios >::fill(void)const " (?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: __thiscall std::basic_ios >::basic_ios >(void)" (??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: void __thiscall std::basic_ostream >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::operator<<(unsigned int)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::operator<<(void const *)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __thiscall std::basic_iostream >::basic_iostream >(class std::basic_streambuf > *)" (??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: virtual __thiscall std::basic_iostream >::~basic_iostream >(void)" (??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::operator<<(int)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: virtual __thiscall std::basic_ostream >::~basic_ostream >(void)" (??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::operator<<(__int64)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::operator<<(double)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::put(char)" (?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: int __thiscall std::ios_base::setf(int,int)" (?setf@ios_base@std@@QAEHHH@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: char __thiscall std::basic_ios >::widen(char)const " (?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::operator<<(class std::basic_ostream > & (__cdecl_)(class std::basic_ostream > &))" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::operator<<(class std::ios_base & (__cdecl
)(class std::ios_base &))" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __thiscall std::locale::id::operator unsigned int(void)" (??Bid@locale@std@@QAEIXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::_Gninc(void)" (?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::_Init(void)" (?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: void __thiscall std::basic_ios >::clear(int,bool)" (?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __thiscall std::basic_istream >::basic_istream >(class std::basic_streambuf > *,bool)" (??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: virtual __thiscall std::basic_istream >::~basic_istream >(void)" (??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in gtest.lib(gtest-all.obj)
13>msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::operator<<(float)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z) already defined in gtest.lib(gtest-all.obj)
13>libcpmtd.lib(ios.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.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 msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.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 msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(locale0.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(locale0.obj) : error LNK2005: "void __cdecl std::_Facet_Register(class std::_Facet_base *)" (?_Facet_Register@std@@YAXPAV_Facet_base@1@@Z) already defined in msvcprtd.lib(locale0_implib.obj)
13>libcpmtd.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 msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(bool)" (?_Init@locale@std@@CAPAV_Locimp@12@_N@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.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 msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.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 msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(cerr.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(cerr.obj) : error LNK2005: "public: __thiscall std::basic_ostream >::basic_ostream >(class std::basic_streambuf > *,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 msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(cerr.obj) : error LNK2005: "public: static unsigned int __cdecl std::codecvt::_Getcat(class std::locale::facet const * *,class std::locale const *)" (?_Getcat@?$codecvt@DDU_Mbstatet@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(cerr.obj) : error LNK2005: "protected: char * __thiscall std::basic_streambuf >::_Gndec(void)" (?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(cerr.obj) : error LNK2005: "protected: void __thiscall std::basic_streambuf >::_Init(char * *,char * *,int *,char * *,char * *,int *)" (?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(cerr.obj) : error LNK2005: "public: bool __thiscall std::codecvt_base::always_noconv(void)const " (?always_noconv@codecvt_base@std@@QBE_NXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(cerr.obj) : error LNK2005: "public: int __thiscall std::codecvt::in(struct _Mbstatet &,char const *,char const *,char const * &,char *,char *,char * &)const " (?in@?$codecvt@DDU_Mbstatet@@@std@@QBEHAAU_Mbstatet@@PBD1AAPBDPAD3AAPAD@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(cerr.obj) : error LNK2005: "public: int __thiscall std::codecvt::out(struct _Mbstatet &,char const *,char const *,char const * &,char *,char *,char * &)const " (?out@?$codecvt@DDU_Mbstatet@@@std@@QBEHAAU_Mbstatet@@PBD1AAPBDPAD3AAPAD@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(cerr.obj) : error LNK2005: "public: int __thiscall std::codecvt::unshift(struct _Mbstatet &,char *,char *,char * &)const " (?unshift@?$codecvt@DDU_Mbstatet@@@std@@QBEHAAU_Mbstatet@@PAD1AAPAD@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(iosptrs.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(locale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(locale.obj) : error LNK2005: "public: static unsigned int __cdecl std::codecvt::_Getcat(class std::locale::facet const * *,class std::locale const *)" (?_Getcat@?$codecvt@DDU_Mbstatet@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(xlock.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(xthrow.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(xthrow.obj) : error LNK2005: "void __cdecl std::_Xbad_alloc(void)" (?_Xbad_alloc@std@@YAXXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(xthrow.obj) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(xthrow.obj) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(wlocale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(wlocale.obj) : error LNK2005: "protected: wchar_t * __thiscall std::basic_streambuf >::_Pninc(void)" (?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(wlocale.obj) : error LNK2005: "protected: wchar_t * __thiscall std::basic_streambuf >::gptr(void)const " (?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(xlocale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(xdateord.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(xwctomb.obj) : error LNK2005: __Getcvt already defined in msvcprtd.lib(MSVCP140D.dll)
13>libcpmtd.lib(winapisupp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(StlCompareStringA.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(winapinls.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(StlCompareStringW.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(StlLCMapStringW.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>libcpmtd.lib(StlLCMapStringA.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in allocatorstest.obj
13>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
12>D:\GITRepos\rapidjson\build\bin\Debug\perftest.exe : fatal error LNK1169: one or more multiply defined symbols found
13>D:\GITRepos\rapidjson\build\bin\Debug\unittest.exe : fatal error LNK1169: one or more multiply defined symbols found
14>------ Build started: Project: ALL_BUILD, Configuration: Debug Win32 ------
15>------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------
15>Project not selected to build for this solution configuration
========== Build: 5 succeeded, 3 failed, 17 up-to-date, 7 skipped ==========

build

Most helpful comment

Google Test is causing the mixed runtime libraries. Try generating the build files while also setting the CMake variable gtest_force_shared_crt to TRUE:

cmake -Dgtest_force_shared_crt=TRUE ..

Tested with RapidJSON commit 1e460910 and Visual C++ 2017 version 19.11.25507.1.

>All comments

Google Test is causing the mixed runtime libraries. Try generating the build files while also setting the CMake variable gtest_force_shared_crt to TRUE:

cmake -Dgtest_force_shared_crt=TRUE ..

Tested with RapidJSON commit 1e460910 and Visual C++ 2017 version 19.11.25507.1.

Was this page helpful?
0 / 5 - 0 ratings