CMake Error: Error: generator : Visual Studio 16 2019
wangqingjia1999 opened this issue · comments
Sorry to bother you. I came across the following issue. I'm a newbie in C++ and CMake, please forgive me if I did something wrong to build this brilliant project. Thanks in advance :-)
Environment
- Window 10 x64-bit
- Visual Studio Enterprise 2019
Issue Description
First, I run gil update
, the following logs are copied from my terminal. It looks fine.
C:\repos\CppLogging>gil update
Working path: C:\repos\CppLogging
Discover git links: C:\repos\CppLogging\.gitlinks
Discover git links: C:\repos\CppLogging\modules\CppBenchmark\.gitlinks
Discover git links: C:\repos\CppLogging\modules\CppCommon\.gitlinks
Create git link: C:\repos\CppLogging\modules\Catch2 -> C:\repos\CppLogging\modules\CppBenchmark\modules\Catch2
Create git link: C:\repos\CppLogging\modules\cpp-optparse -> C:\repos\CppLogging\modules\CppBenchmark\modules\cpp-optparse
Create git link: C:\repos\CppLogging\modules\zlib -> C:\repos\CppLogging\modules\CppBenchmark\modules\zlib
Create git link: C:\repos\CppLogging\build -> C:\repos\CppLogging\modules\CppBenchmark\build
Create git link: C:\repos\CppLogging\cmake -> C:\repos\CppLogging\modules\CppBenchmark\cmake
Create git link: C:\repos\CppLogging\modules\Catch2 -> C:\repos\CppLogging\modules\CppCommon\modules\Catch2
Create git link: C:\repos\CppLogging\modules\CppBenchmark -> C:\repos\CppLogging\modules\CppCommon\modules\CppBenchmark
Create git link: C:\repos\CppLogging\build -> C:\repos\CppLogging\modules\CppCommon\build
Create git link: C:\repos\CppLogging\cmake -> C:\repos\CppLogging\modules\CppCommon\cmake
Create git link: C:\repos\CppLogging\modules\Catch2 -> C:\repos\CppLogging\modules\CppBenchmark\modules\Catch2
Create git link: C:\repos\CppLogging\modules\cpp-optparse -> C:\repos\CppLogging\modules\CppBenchmark\modules\cpp-optparse
Create git link: C:\repos\CppLogging\modules\zlib -> C:\repos\CppLogging\modules\CppBenchmark\modules\zlib
Create git link: C:\repos\CppLogging\build -> C:\repos\CppLogging\modules\CppBenchmark\build
Create git link: C:\repos\CppLogging\cmake -> C:\repos\CppLogging\modules\CppBenchmark\cmake
Create git link: C:\repos\CppLogging\modules\Catch2 -> C:\repos\CppLogging\modules\CppCommon\modules\Catch2
Create git link: C:\repos\CppLogging\modules\CppBenchmark -> C:\repos\CppLogging\modules\CppCommon\modules\CppBenchmark
Create git link: C:\repos\CppLogging\build -> C:\repos\CppLogging\modules\CppCommon\build
Create git link: C:\repos\CppLogging\cmake -> C:\repos\CppLogging\modules\CppCommon\cmake
However, here comes the problem:
C:\repos\CppLogging\build>vs.bat
CMake Error: Error: generator : Visual Studio 16 2019
Does not match the generator used previously: MinGW Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
Also, I have noticed that the Error List of Visual Studio has the following error:
1> [CMake] CMake Error at cmake/SetPlatformFeatures.cmake:29 (string):
1> [CMake] string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
1> [CMake] command.
1> [CMake] Call Stack (most recent call first):
1> [CMake] CMakeLists.txt:26 (include)
1> [CMake] -- The System identification is Windows-10.0.19041 Windows 10.0.19041 Platform/Windows
Some Tries
I did some simple tries but the issue remains the same, like:
- delete the Cmake cache and rebuild it;
- try both 32-bit and 64-bit mode;
If you change your generator (MinGW->Visual Studio) you have to remove ./temp directory
CMake Error: Error: generator : Visual Studio 16 2019
Does not match the generator used previously: MinGW Makefiles
Thanks for your sincere help! I should have read the error message carefully. 😄