我正在尝试在Windows上运行CMake,但是遇到了以下错误:
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:3 (PROJECT):
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
然而我的"CC"环境变量已经设置好了!
>>echo %CC%
C:\Anaconda2\MinGW\x86_64-w64-mingw32\bin\gcc.exe
cmake.exe ...
命令?另外一个猜测是C:\Anaconda2\MinGW\x86_64-w64-mingw32\bin
不在您的PATH
环境变量中(正如错误信息所示)。请参考这里。 - FlorianPATH
中,错误信息如下:通过设置环境变量"CC"或CMake缓存条目CMAKE_C_COMPILER的完整路径,或者设置为编译器名称(如果在PATH中),告诉CMake在哪里找到编译器。所以我的CC指向完整路径,而不仅仅是名称...不应该有任何问题。 - João Abrantes