C++ Visual Studio:MSB3073 错误退出,代码为 1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31457306/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 13:57:22  来源:igfitidea点击:

Visual Studio: MSB3073 error exited with code 1

c++visual-studiodcmtk

提问by noobalert

everyone. I am compiling DCMTK 3.6.1 in Visual Studio 2013. My OS is Windows 8. I also used CMake 3.2.3. I have already successfully compiled both x64 versions of debug and release for the ALL_BUILD project. However, for the INSTALL project, I can't compile it because the following error occurs:

每个人。我正在 Visual Studio 2013 中编译 DCMTK 3.6.1。我的操作系统是 Windows 8。我还使用了 CMake 3.2.3。我已经为 ALL_BUILD 项目成功编译了 x64 版本的调试和发布。但是,对于INSTALL项目,我无法编译它,因为出现以下错误:

Error   1   error MSB3073: The command "setlocal
"C:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets  132

According to this link, I need admin rights. But I am already running Visual Studio in Admin mode. Can someone please enlighten me on what I might be doing wrong? Thank you very much!

根据此链接,我需要管理员权限。但我已经在管理员模式下运行 Visual Studio。有人可以请教我我可能做错了什么吗?非常感谢!

采纳答案by J. Riesmeier

What about specifying another value for CMAKE_INSTALL_PREFIX in the CMake GUI? That means, a directory where you definitely have write access.

在 CMake GUI 中为 CMAKE_INSTALL_PREFIX 指定另一个值怎么样?这意味着,您绝对具有写访问权限的目录。

回答by Dimitar Veljanovski

This is a simple 2 step fix.

这是一个简单的 2 步修复。

First step is to remove the Read Onlyfolder property. To do this, just go wherever you cloned the software you want to build, right click on the containing folder and uncheck the Read Onlycheckmark.

第一步是删除Read Only文件夹属性。为此,只需转到克隆要构建的软件的任何位置,右键单击包含的文件夹并取消选中复选Read Only标记。

Second step is to exit visual studio and start terminal as administrator/with sudo privileges if on linux/mac. Navigate to the build folder and type the solution name. This will open up VC with admin privileges.

第二步是退出visual studio并以管理员身份启动终端/如果在linux/mac上使用sudo权限。导航到构建文件夹并键入解决方案名称。这将打开具有管理员权限的 VC。

This fixed the problem for me.

这为我解决了问题。