Visual Studio: MSB3073 error exited with code 1
Asked Answered
G

7

23

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:

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!

Gratify answered 16/7, 2015 at 14:37 Comment(2)
That error can happen for a variety of reasons. Usually there's an error log you can actually examine. Search for CMakeOutput.log and CMakeError.log and see if they give you any more details.Boltonia
I had same problem and I set new address without Space in it and it's worked.Bertrand
N
22

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

Nationalist answered 23/7, 2015 at 12:57 Comment(3)
I changed it to a new directory in C that will not need admin rights and has a name that has no spaces (just to be sure) and it worked! Thank you!Gratify
How to add CMAKE_INSTALL_PREFIX in CMakeLists.txt?Arthromere
@Arthromere Instead of doing that, you could 1. modify the property in CMakeCache.txt or 2. use CMake GUI to point to your folder that contains CMakeLists.txt, modify the property, then press the Generate button, which does the same thingMossberg
S
6

This is an old post, but I encountered the same problem when I attempted to install OpenCV for Windows 10 using VS 16 2019 in a folder close to the root of C:.

Solution: Open cmd as administrator, open the SLN-project (In my case <OpenCV.sln>), and run Build on INSTALL. That worked like a charm.

Saudra answered 7/1, 2021 at 15:10 Comment(0)
R
1

Sometimes the build output will give some more context than the error itself.

In my case this issue was caused by an invalid filepath being given as something that should be installed.

Riordan answered 16/8, 2023 at 14:26 Comment(0)
G
0

This is a simple 2 step fix.

First step is to remove the Read Only folder 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 Only checkmark.

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.

This fixed the problem for me.

Goto answered 19/5, 2020 at 8:41 Comment(1)
what about windows ??Acetyl
E
0

Just open a prompt and run "C:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake (or similar showed in VS error list) and see where is the problem in my case the problem was samples were not compiled, so i entered in modules directory and compile manually each module necessary. After compile the module i run the command again and see what happen, repeat until solve the problem

Evvoia answered 16/8, 2021 at 20:14 Comment(0)
P
0

the best solution; CMAKE_INSTALL_PREFIX if you choose realease/debug then after CMake configure by CMake on the same mood. just try

Polypropylene answered 13/4, 2022 at 3:33 Comment(0)
E
0

I had a similar error, if you can check that there are no spaces or character symbols in your path. FOr example I had a directory with the file name 'ABC&D' and by removing & the error was fixed. This coupled with allowing admin rights should be an attempt to fix the problem.

Exon answered 28/6, 2022 at 15:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.