我正在尝试设置Kdevelop并遇到编译器错误。
C:/Users/alexm/projects/SFMLGL/build> "C:/Program Files/CMake/bin/cmake.exe" "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" "-DCMAKE_BUILD_TYPE=Debug" C:/Users/alexm/projects/SFMLGL
-- The C compiler identification is unknown
CMake Error at C:/Program Files/CMake/share/cmake-3.6/Modules/CMakeDetermineCompilerId.cmake:141 (file):
file problem creating directory:
C:/Users/alexm/projects/SFMLGL/build/CMakeFiles/3.6.1/CompilerIdCXX
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.6/Modules/CMakeDetermineCompilerId.cmake:40 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
C:/Program Files/CMake/share/cmake-3.6/Modules/CMakeDetermineCXXCompiler.cmake:113 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:2 (project)
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (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.
CMake Error at CMakeLists.txt:2 (project):
The CMAKE_CXX_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 "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/Users/alexm/projects/SFMLGL/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/alexm/projects/SFMLGL/build/CMakeFiles/CMakeError.log".
*** Failure: Exit code 1 ***
我一直在谷歌上搜索并且读到我应该下载“Make”,所以我有,它确实减少了我的错误数量,但我仍然有这个,我不明白它的一个词。
我想它要我下载一个C编译器?我该怎么做呢?
答案 0 :(得分:2)
CMake
的默认工具链尝试使用Visual Studio C ++编译器。
如果要使用Visual Studio(需要安装),可以从开始菜单中的»VS201X x64 Native Tools命令提示符«快捷方式运行CMake
命令。
另一种方法是通过msys2中提供的mingw-w64使用GCC for Windows。在那里你必须通过pacman -S mingw-w64-x86_64-toolchain
安装编译器,并且可选择通过pacman -S mingw-w64-x86_64-cmake
进行编译
然后,您可以从msys2的mingw64提示符运行命令。
如果要在KDevelop中使用它,则必须将msys64 / mingw64 /文件夹添加到路径中,或者从上面提到的Visual Studio命令提示符启动它。我不确定是否有更简单的方法。
你的问题提出了^^你想要达到的目标。您似乎不知道要使用哪个编译器(如果您有二进制依赖项,这可能很重要)或make
是什么(这有点令人担忧)。