Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual C++ build error: Failed to register output

So I have this project I'm working on, and every time I build, it builds then executes the program, and then finishes with a build error. Why does this happen? I can't seem to find in the project properties where it would execute the file on the build.
It is kind of annoying, and it also ends up spawning an error. Here's an excerpt from the output

2>Link:
2>  Generating code
2>c:\users\d0c\desktop\jlrria.lottery.repo\trunc\hash\hl_hashwrapper.h(277): warning C4706: assignment within conditional expression
2>  Finished generating code
2>  lottery-gui.vcxproj -> C:\Users\d0c\Desktop\jlrria.Lottery.repo\trunc\build\Release\lotteryslayer.exe
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(741,5): warning MSB3073: The command ""C:\Users\d0c\Desktop\jlrria.Lottery.repo\trunc\build\Release\lotteryslayer.exe" /RegServerRedirect" exited with code 2.
2>  The previous error was converted to a warning because the task was called with ContinueOnError=true.
2>  Build continuing because "ContinueOnError" on the task "Exec" is set to "true".<br>
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(744,5): error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.
2>
2>Build FAILED.

So I guess I'm looking for help with two things
First and most importantly: Why is it executing the build program
Second: Why am I getting this error?

thanks. ALSO There are no items in the post build, otherwise, the log above would say "post-build" :p

like image 828
Kelly Elton Avatar asked Aug 20 '11 18:08

Kelly Elton


2 Answers

Start with Visual Studio with Administrator rights. You can do so by right clicking on VS shortcut and Select Run As Administrator. Or create a shortcut where you would enable Run As Admin.

Reason:

Look at the error:

error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.

Also, it seems to be a DLL/ActiveX control project. Look at: Linker->General->Register Output and set it to NO.

like image 130
Ajay Avatar answered Sep 17 '22 18:09

Ajay


You are building an ATL project? Seems to be a bug in VS2010, http://social.msdn.microsoft.com/Forums/en/vcprerelease/thread/11f01ceb-52a4-438f-b7ef-727ce7a3e191 concerning ATL projects.

like image 42
john Avatar answered Sep 17 '22 18:09

john