设置 Kdevelop

Setting up Kdevelop

我正在尝试设置 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编译器?我该怎么做?

CMake 的默认工具链尝试使用 Visual Studio C++ 编译器。

如果你想使用 Visual Studio(你需要安装它),你可以 运行 你的 CMake 命令来自开始菜单。

另一种方法是通过 msys2 中提供的 mingw-w64 为 Windows 使用 GCC。在那里你必须通过 pacman -S mingw-w64-x86_64-toolchain 安装编译器,也可以通过 pacman -S mingw-w64-x86_64-cmake.
安装 cmake 然后,您可以从 msys2 的 mingw64 提示符 运行 您的命令。

如果你想在 KDevelop 中使用它,你必须将你的 msys64/mingw64/ 文件夹添加到路径中,或者从上面提到的 Visual Studio 命令提示符启动它。我不确定是否有更简单的方法。

你的问题提出了问题^^你到底想达到什么目的。您似乎不知道要使用哪个编译器(如果您有二进制依赖项,这可能很重要)或者 make 是什么(这有点令人担忧)。