noobalert
noobalert

Reputation: 865

Visual Studio: MSB3073 error exited with code 1

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!

Upvotes: 23

Views: 62327

Answers (7)

Catcow
Catcow

Reputation: 27

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.

Upvotes: 1

FretBuzz
FretBuzz

Reputation: 11

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.

Upvotes: 0

Ben
Ben

Reputation: 61

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

Upvotes: 0

Anderson Souza
Anderson Souza

Reputation: 1

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

Upvotes: 0

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.

Upvotes: 6

Dimitar
Dimitar

Reputation: 1180

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.

Upvotes: 0

J. Riesmeier
J. Riesmeier

Reputation: 1702

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

Upvotes: 22

Related Questions