Alex
Alex

Reputation: 65934

VC ++ express, how do I fix this error?

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 ==========

Upvotes: 4

Views: 7728

Answers (6)

Robert Grubba
Robert Grubba

Reputation: 1

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

Upvotes: 0

user3758062
user3758062

Reputation: 77

Project : error PRJ0002 : Error result 31 returned from 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe'.

Faced the same issue Cleaning the rebuilding solved it.

Upvotes: 1

Gabor Forgacs
Gabor Forgacs

Reputation: 505

I turned off the Microsoft Security Essentials and the problem is gone. Strange that it only happened for the debug configuration.

Upvotes: 0

Guilherme Dellagustin
Guilherme Dellagustin

Reputation: 21

try setting your AV to ignore your project directories instead of VC++ directory.

Upvotes: 2

Arve
Arve

Reputation: 7506

Microsoft blames antivirus for a similar case.

Upvotes: 5

brainiac
brainiac

Reputation: 404

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.

Upvotes: 2

Related Questions