CMake 配置失败.“cl.exe 无法编译简单的测试程序" [英] CMake configuring fails. "cl.exe is not able to compile a simple test program"

查看:65
本文介绍了CMake 配置失败.“cl.exe 无法编译简单的测试程序"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 CMake 为 MSVC++2010 构建解决方案.因为我安装了不再工作的 Visual Studio 2012.CMake 带有以下错误消息:《C 编译器》C:/Program Files (x86)/Microsoft Visual Studio10.0/VC/bin/cl.exe"无法编译简单的测试程序."

I am trying to build a solution for MSVC++2010 using CMake. Since I installed Visual Studio 2012 that does not work anymore. CMake comes with the following error message: "The C compiler "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe" is not able to compile a simple test program."

在为我的问题寻找解决方案时,我发现了这个话题(Cmake 无法为 Visual Studios 10 amd64 配置项目)虽然解决了我的问题,但该解决方案对我不起作用.

While searching a solution for my problem I found this topic (Cmake is Unable to Configure Project for Visual Studios 10 amd64) which though adresses my problem but the solution doesn't work for me.

任何帮助将不胜感激.

推荐答案

我遇到了同样的问题.上述解决方案对我不起作用.在查看这篇文章后,我的问题得到了解决.

I had the same problem. The above solution didn't work out for me. My problem was solved after looking into this post.

首先,检查您的系统上是否安装了 .NET 4.5.如果这样做,那很可能会导致问题.尝试升级到 VS2010 SP1 或将 .NET 降级到 4.0

First, check if you have .NET 4.5 on your system. If you do, that is very likely causing the problem. Try either upgrading to VS2010 SP1 or downgrade .NET to 4.0

原因:

出现此错误是因为您在系统中实际安装了Visual C++ 2010后安装了Visual C++ 2012;另一个原因是因为.net Framework 4.5 替换了.net Framework 4.0;.net Framework 损坏的文件;

This error appears because you have installed Visual C++ 2012 after you have actually installed Visual C++ 2010 in your system; another cause is because .net Framework 4.5 replace .net Framework 4.0; .net Framework corrupted files;

如何解决

从您的系统中卸载 .NET Framework 4.5;然后下载 .NET Framework 4.0 并安装它;这应该可以解决您的问题;

Uninstall .NET Framework 4.5 from your system; then download .NET Framework 4.0 and install it; this should fix your problem;

这篇关于CMake 配置失败.“cl.exe 无法编译简单的测试程序"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆