MSBuild: 'error MSB6006: "cmd.exe"退出代码 1.'

编程入门 行业动态 更新时间:2024-10-07 04:30:19
本文介绍了MSBuild: 'error MSB6006: "cmd.exe"退出代码 1.'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

尝试使用 CMake 和 MSBuild 构建 TensorFlow 时在 Windows 10 上,运行 MSBuild 时出现以下错误:

When attempting to build TensorFlow with CMake and MSBuild on Windows 10, I get the following error when running MSBuild:

"C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_tutorials_example_trainer.vcxproj" (default target) (1) ->
"C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_core_gpu_kernels.vcxproj" (default target) (90) ->
(CustomBuild target) ->
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_core_gpu_kernels.vcxproj]

    351 Warning(s)
    1 Error(s)

所以我只收到一条错误消息,这只是告诉我 cmd.exe 已关闭,错误代码表明存在问题,但没有说明问题是什么.那么我怎样才能找出导致这个问题的原因,以便我可以解决它?

So I only get one error message, and that just tells me that cmd.exe was closed with an error code indicating that there was a problem, but not what the problem was. So how can I find out what caused this problem so I can solve it?

推荐答案

这个错误经常发生,因为默认的 cmake 安装位置需要管理员权限(通常是 C:/Program Files/).

This error commonly happens because the default cmake install location requires admin privileges (normally C:/Program Files/).

有两种简单的方法可以解决这个问题:

There are two simple ways around this:

以管理员身份运行visual studio覆盖 CMAKE_INSTALL_PREFIX 变量以指向不需要管理员权限的地方就个人而言,我推荐第二个选项(配置 cmake 时,命令类似于:cmake . -DCMAKE_INSTALL_PREFIX=D:/Some/Path)

Run visual studio as Administrator Override the CMAKE_INSTALL_PREFIX variable to point somewhere not requiring admin privileges Personally, I'd recommend the second option (When configuring cmake, the command would be something like: cmake . -DCMAKE_INSTALL_PREFIX=D:/Some/Path)

这篇关于MSBuild: 'error MSB6006: "cmd.exe"退出代码 1.'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-05-01 01:12:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1402424.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:代码   error   MSBuild   amp   exe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!