cmake报错

cmake … 报错:

The CMAKE_C_COMPILER:cl is not a full path and was not found in the
PATH.

解决方案1:

cmake -G “MSYS Makefiles” …

解决方案2:

$ export CC=/c/MinGW/bin/gcc.exe
$ export CXX=/c/MinGW/bin/g++.exe
$ cmake -G "MinGW Makefiles" ..
-- The CXX compiler identification is GNU 4.8.1        
...
$ mingw32-make

解决方案3:

$ cmake -DCMAKE_C_COMPILER=/c/MinGW/bin/gcc.exe -DCMAKE_CXX_COMPILER=/c/MinGW/bin/g++.exe ..

参考:
https://blog.csdn.net/qq_40604853/article/details/89351203

实践后成功的是解决方案2:
在这里插入图片描述
VSCode与CMake搭配使用之基本配置
https://blog.csdn.net/jiasike/article/details/107474368

你可能感兴趣的:(计算机基础知识,cmake)