Visual C ++生成错误:无法注册输出

时间:2011-08-20 18:52:24

标签: c++ visual-c++ build

所以我正在开发这个项目,每次构建时,它都会构建然后执行程序,然后以构建错误结束。为什么会这样?我似乎无法在项目属性中找到它将在构建上执行文件的位置。
它有点烦人,它最终也会产生错误。这是输出的摘录

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.

所以我想我正在寻找两件事的帮助
首先,最重要的是:为什么要执行构建程序
第二:为什么我收到此错误?

感谢。 也 帖子构建中没有项目,否则,上面的日志会说“post-build”:p

2 个答案:

答案 0 :(得分:13)

从具有管理员权限的Visual Studio开始。您可以通过右键单击VS快捷方式并选择Run As Administrator来执行此操作。或者创建一个快捷方式,您可以在其中启用Run As Admin

原因:

查看错误:

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

此外,它似乎是一个DLL / ActiveX控件项目。查看:Linker-&gt; General-&gt; Register Output并将其设置为NO。

答案 1 :(得分:1)

您正在构建ATL项目?似乎是VS2010中的一个错误,http://social.msdn.microsoft.com/Forums/en/vcprerelease/thread/11f01ceb-52a4-438f-b7ef-727ce7a3e191涉及ATL项目。