I was executing the cmake in a normal command prompt. I have tried in a powershell but there was a similar result. The script get_repo_version.ps1 couldn’t be executed due to security restrictions. I had to call:
Now I’m stumbling with linking errors, hundreds of them:
LiteCoreStatic.lib(c4Base.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
LiteCoreStatic.lib(c4Base.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MTd_StaticDebug' in main.obj
LiteCoreStatic.lib(c4Database.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
LiteCoreStatic.lib(c4Database.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MTd_StaticDebug' in main.obj
LiteCoreStatic.lib(c4Document.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
LiteCoreStatic.lib(c4Document.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MTd_StaticDebug' in main.obj
LiteCoreStatic.lib(c4DocEnumerator.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
LiteCoreStatic.lib(c4DocEnumerator.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MTd_StaticDebug' in main.obj
LiteCoreStatic.lib(c4Observer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
...
I’m googling around to find a solution. If you have any suggestion, I’m all hears!
You need to compile all of your components with the same c++ runtime library variant. This kind of thing happens when you mix default debug and release builds for example since one will link with the debug runtime and the other with the release runtime.
i am able to generate visual studio solution file but when i open CouchbaseLite_C.sln file with visual studio 2019 i am getting following error:
13>Done building project “CouchbaseLiteC.vcxproj” – FAILED.
14>------ Build started: Project: CBL_C_Tests, Configuration: Release x64 ------
14>Building Custom Rule C:/Users/mostain/Desktop/couchbase/database/couchbase-lite-C/test/CMakeLists.txt
14>BlobTest_Cpp.cc
14>C:\Users\mostain\Desktop\couchbase\database\couchbase-lite-C\build_cmake\test..\include\cbl\cbl_config.h(19,10): fatal error C1083: Cannot open include file: ‘asprintf.h’: No such file or directory
14>CBLTestsMain.cpp
14>C:\Users\mostain\Desktop\couchbase\database\couchbase-lite-C\build_cmake\test..\include\cbl\cbl_config.h(19,10): fatal error C1083: Cannot open include file: ‘asprintf.h’: No such file or directory
14>DatabaseTest.cc
14>C:\Users\mostain\Desktop\couchbase\database\couchbase-lite-C\build_cmake\test..\include\cbl\cbl_config.h(19,10): fatal error C1083: Cannot open include file: ‘asprintf.h’: No such file or directory
14>DatabaseTest_Cpp.cc
14>C:\Users\mostain\Desktop\couchbase\database\couchbase-lite-C\build_cmake\test..\include\cbl\cbl_config.h(19,10): fatal error C1083: Cannot open include file: ‘asprintf.h’: No such file or directory
14>QueryTest.cc
14>C:\Users\mostain\Desktop\couchbase\database\couchbase-lite-C\build_cmake\test..\include\cbl\cbl_config.h(19,10): fatal error C1083: Cannot open include file: ‘asprintf.h’: No such file or directory
14>ReplicatorTest.cc
14>C:\Users\mostain\Desktop\couchbase\database\couchbase-lite-C\build_cmake\test..\include\cbl\cbl_config.h(19,10): fatal error C1083: Cannot open include file: ‘asprintf.h’: No such file or directory
14>Generating Code…
14>Done building project “CBL_C_Tests.vcxproj” – FAILED.
15>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
========== Build: 11 succeeded, 4 failed, 0 up-to-date, 0 skipped ==========