简体   繁体   English

编译Visual Studio C ++项目时出错-cl.exe错误

[英]Error compiling Visual Studio C++ project - error with cl.exe

I'm running Visual Studio 2005 Pro, and have been getting the following error recently: 我正在运行Visual Studio 2005 Pro,并且最近收到以下错误:

Error 1 Error result -1 returned from 'C:\Program Files\Microsoft Visual Studio 8\VC\bin\cl.exe'.

Reading some of the other posts around here, I've learned that cl.exe is native to VS 2008. I do have an install of 2008 Express (but C# only), and recently I uninstalled VS 2010 Express. 在这里阅读其他文章时,我了解到cl.exe是VS 2008的本机。我确实安装了2008 Express(但仅C#),最近又卸载了VS 2010 Express。 Could there be some sort of leftover compatibility issue going on here for me? 我这里可能会发生某种剩余兼容性问题吗?

edit Ok, let's go with it isn't a compatibility issue. 编辑好的,让我们开始吧,这不是兼容性问题。 Any thoughts on how to fix the error? 关于如何纠正错误的任何想法?

cl.exe是Microsoft C ++编译器,其名称至少与Visual Studio 6相同。它在Visual Studio 8文件夹中的事实也告诉您它是VS2005,因为VS2008是VS9,而VS2010是VS10。

Possibly although, VS 2008 installed into a "Visual Studio 9.0" directory and Visual Studio into "Visual Studio 10.0". 尽管可能,VS 2008安装到“ Visual Studio 9.0”目录中,而Visual Studio安装到“ Visual Studio 10.0”中。 So on balance I wouldn't have thought so. 所以总的来说,我不会这么想。

It turns out that the error is not with Visual Studio, but with the test suite that I'm ultimately working with. 事实证明,该错误不是与Visual Studio有关,而是与我最终使用的测试套件有关。 It replaces cl.exe and link.exe with its own executables, and moves them to different filenames. 它将cl.exe和link.exe替换为其自己的可执行文件,并将它们移至其他文件名。 Fixing some issues with my test suite made it work again. 解决了我的测试套件的一些问题后,它又可以正常工作了。

I didn't realize this until I ran cl.exe from the VS command line...thanks for the suggestions though! 直到我从VS命令行运行cl.exe时,我才意识到这一点。尽管如此,还是感谢您的建议!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Visual Studio C ++中编译时出现错误2,代码退出MSB6006“ CL.exe” - Error MSB6006 “CL.exe” exited with code 2 in compile in visual studio c++ “ CL.exe”未在独立项目中编译C ++ - “CL.exe” Not Compiling C++ in stand alone project c ++编译问题—使用cl.exe可以正常编译,但无法从Visual Studio 2015进行编译 - c++ compiling issue — Compiles fine with cl.exe but will not compile from Visual Studio 2015 为什么 cl.exe(Visual Studio 编译器)无法使用 CMake(错误报告)编译项目? - How come cl.exe (Visual Studio compiler) fails to compile a project with CMake (error-report)? 执行cl.exe时出错 - Error executing cl.exe 为 cl.exe (Visual Studio Code) 指定命令行 C++ 版本 - Specify command-line C++ version for cl.exe (Visual Studio Code) 如何使用从 cl.exe(Visual Studio C/C++ 编译器)生成的 a.exe 从命令行调试 a.exe? - How can I debug a .exe from the command line with a .exe generated from cl.exe (Visual Studio C/C++ Compiler)? Visual Studio 2017 - 错误MSB6006:“CL.exe”退出代码2 - Visual studio 2017 - error MSB6006: “CL.exe” exited with code 2 针对此cpp代码使用cl.exe(Visual Studio 2008)编译错误 - Compile error using cl.exe (Visual Studio 2008) for this cpp code Visual Studio 2008中的cl.exe包装器 - cl.exe wrapper in Visual Studio 2008
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM