分页: 1 / 1

[已解决]CMake提示 No CMAKE_C_COMPILER could be found

发表于 : 2016年10月14日 18:54
523066680
D:\Temp\sb7code-master>cmake -G"Visual Studio 12 2013" .
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.

-- Configuring incomplete, errors occurred!
See also "D:/Temp/sb7code-master/CMakeFiles/CMakeOutput.log".
See also "D:/Temp/sb7code-master/CMakeFiles/CMakeError.log".

Re: [已解决]CMake提示 No CMAKE_C_COMPILER could be found

发表于 : 2016年10月14日 19:10
523066680
原因是Path环境变量没有设置好,找到vs2013 对应的 cl.exe所在路径,临时加到path中(64位):

代码: 全选

set path=%path%;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64

Re: [已解决]CMake提示 No CMAKE_C_COMPILER could be found

发表于 : 2017年05月16日 20:09
523066680
坦白,当时我遇到这个问题,不只是 path 的缘故,还因为我的 VS2013 安装出了问题,不能正常使用。
而且之后卸载重装VS多次失败。

如果你也是 Visual Studio 组件出了问题,且多次安装失败,
解决方法:

在清洁模式下启动
参考: how-to-perform-a-clean-boot-in-windows

打开 msconfig 点击[服务]选项 -> 隐藏所有 Microsoft 服务
然后将剩下的服务无全部禁用,

点击 [启动]选项卡,将非必须的自启动进程禁用。

卸载驱动精灵以及相关的流氓软件,重启。经本人测试,安装VS2015,VS2013,VS2010成功,

没有 C:\Config.Msi 目录写入文件失败的问题,没有其他安装失败问题。