所以我正在尝试根据 youtube 上的本教程配置一个非常简单的文件:
https://www.youtube.com/watch?v=gYmgbqGfv-8
我在 Windows 10 中使用 CMake GUI,我有一个正在运行的 Visual Studio 2015,它已经能够构建 C++ 项目(我已经使用了一段时间)
我使用“Visual Studio 15 2017”
我为两个输入创建了一个名为 hellocmake 和 hellocmake/build 的文件夹:
但是当我尝试配置时,它说
CMake Error at CMakeLists.txt:1 (PROJECT):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:1 (PROJECT):
No CMAKE_CXX_COMPILER could be found.
错误日志指出找不到这两个编译器文件:
编译 C 编译器标识源文件“CMakeCCompilerId.c”失败。
编译器:
构建标志:
标识标志:
The output was:
The system cannot find the file specified
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
The system cannot find the file specified
我尝试下载“CMakeCXXCompilerId.cpp”和“CMakeCXXCompilerId.c”文件并尝试将它们手动添加到同一文件夹中,但没有解决问题
我试图查找其他几个具有类似案例的来源,但我似乎无法理解它们。 我的旧计算机不存在这个问题,所以我认为它与 Visual Studio 有关?
谢谢你们,任何帮助将不胜感激
最佳答案
您选择了尚未安装的 Visual Studio 2017。我认为您混淆了版本发布年份的实际版本号(VS2017 为 15)。选择一个 VS2015 生成器(版本号 14),它应该可以工作。
关于c++ - CMake : C and CXX compiler identification is unknown Win10 CMakeGUI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40975780/