VC ++快递,我该如何修复这个错误?
我有 C# 编程经验,但本学期我正在学习 C++ 课程,并且正在编写我的第二个项目,但当我尝试构建程序的调试配置时,我不断收到此错误。
我的构建日志如下,对发生的事情有什么想法吗?我不知所措。
谢谢大家!
1>------ Rebuild All started: Project: Project_2, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'Project_2', configuration 'Debug|Win32'
1>Compiling...
1>main.cpp
1>Linking...
1>LINK : C:\Users\Alex\Documents\Visual Studio 2008\Projects\Project_2\Debug\Project_2.exe not found or not built by the last incremental link; performing full link
1>Embedding manifest...
1>Project : error PRJ0002 : Error result 31 returned from 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe'.
1>Build log was saved at "file://c:\Users\Alex\Documents\Visual Studio 2008\Projects\Project_2\Project_2\Debug\BuildLog.htm"
1>Project_2 - 1 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I have experience programming in C#, but I'm taking a C++ class this semester, and I'm writing my second project, but I keep getting this error when I try to build a debug configuration of my program.
My build log is below, any ideas on what's going on? I'm at a loss.
Thanks everyone!
1>------ Rebuild All started: Project: Project_2, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'Project_2', configuration 'Debug|Win32'
1>Compiling...
1>main.cpp
1>Linking...
1>LINK : C:\Users\Alex\Documents\Visual Studio 2008\Projects\Project_2\Debug\Project_2.exe not found or not built by the last incremental link; performing full link
1>Embedding manifest...
1>Project : error PRJ0002 : Error result 31 returned from 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe'.
1>Build log was saved at "file://c:\Users\Alex\Documents\Visual Studio 2008\Projects\Project_2\Project_2\Debug\BuildLog.htm"
1>Project_2 - 1 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
微软将类似情况归咎于防病毒软件。
Microsoft blames antivirus for a similar case.
您应该查看构建输出中给出的 buildlog.htm 文件。它将为您提供有关所发生事件的更多(有用)信息。
You should look at the buildlog.htm file that is given in the build output. It will give you more (useful) information about what has happened.
尝试将 AV 设置为忽略项目目录而不是 VC++ 目录。
try setting your AV to ignore your project directories instead of VC++ directory.
面临同样的问题清理重建解决了它。
Faced the same issue Cleaning the rebuilding solved it.
我关闭了 Microsoft Security Essentials,问题就消失了。
奇怪的是,它只发生在调试配置中。
I turned off the Microsoft Security Essentials and the problem is gone.
Strange that it only happened for the debug configuration.
我在构建管道中遇到了类似的问题,95-99% 的构建都会引发错误。 mt.exe 中似乎存在与先前构建步骤中的锁定文件相关的问题;如果 mt.exe 延迟 5 秒执行,则完全没有问题。我注意到,这个问题可以通过在构建中引入一些延迟或用 v7.1 SDK 中的 mt.exe 替换二进制文件来解决
I've meet similar problem in my build pipeline, the error was thrown for 95-99% of the builds. It looks like there was a problem in mt.exe assosociated with locked files from previous build steps; If mt.exe was executed with 5s delay there was no problem at all. I've noticed, that the problem may be fixed by introducing some delay in build or by replacing the binary with mt.exe from v7.1 SDK