构建服务器上的VS2015 MSBuild找不到cl.exe [英] VS2015 MSBuild on build server cannot find cl.exe

查看:92
本文介绍了构建服务器上的VS2015 MSBuild找不到cl.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I did try the Visual C++ Build Tools 2015 on a test build machine and it seems to work with my C++ solutions, but it is a pre-release and not meant for production. I need something that will work for production, so I have installed Microsoft Build Tools 2015, Windows 10 SDK, and Visual C++ Redistributable for Visual Studio 2015 and copied some of the files that are listed under Build Server lists.

使用预发行版工具在计算机上构建的版本使用" C:\ Program Files(x86) \ Microsoft Visual Studio 14.0 \ VC \ bin \ x86_amd64 \ CL.exe",在运行MSBuild和 构建完成,但是我的另一台机器仅使用"CL.exe"当使用相同的代码调用并给出错误TRK0005时:找不到:"CL.exe".显然,将环境变量应用于某种问题 对MSBuild的调用,但我不确定下一步要去哪里.这两台计算机上的系统变量相同,因此还有其他事情告诉使用预发行版工具的计算机在哪里可以找到CL.exe的路径.

The builds on the machine using the pre-release tools use "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe" when running MSBuild and the build completes, but my other machine uses just "CL.exe" when called with the same code and gives the error TRK0005: Failed to locate: "CL.exe". Clearly there is some kind of problem with environment variables being applied to the call to MSBuild, but I'm not sure where to look next. The system variables are the same on both machines, so something else is telling the machine with the pre-release tools where to find this path for CL.exe. 

任何帮助将不胜感激.

注意:如果有帮助,请从命令提示符运行CL.exe,我会收到一条错误消息,指出它由于缺少VCRUNTIME140.dll而无法启动.它位于System32文件夹中,该文件夹位于我的路径中.

Note: In case it helps, running CL.exe from a command prompt, I get an error saying it can't start because VCRUNTIME140.dll is missing. It is there in the System32 folder, which is in my Path. 

如果我尝试使用vcvarsall.bat,它声称找不到通用工具.

And if I try to use vcvarsall.bat, it claims it can't find Common Tools.

推荐答案

KaHend,

Hi KaHend,

无法找到:"CL.exe".听起来好像找不到文件.

Failed to locate: "CL.exe".  really sounds like the file cannot be found.

也许您可以尝试以下博客中的解决方案:

Perhaps you can give a try with the solution from this blog: http://blogs.msdn.com/b/deva/archive/2015/03/25/after-migration-vs-2013-c-project-throws-error-trk0005-failed-to-locate-quot-cl-exe-quot-the-system-cannot-find-the-file-specified.aspx

将CL.exe所在的位置的可执行目录路径添加到Visual Studio中似乎可以使其正常工作.

Add the Executable directories path to the place where CL.exe exists to Visual Studio seems can make it work.

-詹姆斯

--James


这篇关于构建服务器上的VS2015 MSBuild找不到cl.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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