Error code 31 returned from mt.exe when building C++ projects in Visual Studio 2013

1.4k views Asked by At

Background: I'm trying to create a project in Visual Studio 2013 that manages the build process for a large C++ solution (along with documentation, version control, etc.). The solution that is the focus of the build process was written in Visual Studio 2008 (with service pack 1), and so my project calls the 2008 version of devenv.com to accomplish the build. I compile my code in 8 configurations (Debug, Release, Threadsafe-Debug, Threadsafe-Release) X (Win32, x64).

Issue: The problem that I am encountering is a problem that seems to pop up a bit on the internet (occurs after Embedding Manifest...):

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

Looking at the build log, this seems to be caused by the following:

Creating temporary file "c:\...\RSP00003948847144.rsp" with contents
[
/outputresource:"...\TARGET_DLL;#2" /manifest
"...\TARGET_DLL.intermediate.manifest"
]

Creating command line "mt.exe @"c:\...\RSP00003948847144.rsp" /nologo" 

So, it appears that mt.exe is trying to run the options specified in the temporary file. The error codes for mt.exe are not really listed online, so I am stuck trying to figure out what error code 31 means. People have said that it may be caused by some kind of access violation, where files that mt.exe is trying to access are locked by some other process (potentially the antivirus program).

However, all the suggested solutions that I am able to implement for this problem have not worked. Note: I am not able to prevent the linker from creating manifests in the VS2008 projects that I am trying to compile, nor am I able to change the settings on the Antivirus software.

Thus, I was wondering if somebody could help me on this specific error. Failing that, I would like to know how I can track which files are locked by an application at a given time (and which application locks them). Also, I would like to know how I can "debug" an error like this, i.e. figure out exactly what mt.exe is trying to access, and pause its execution to examine what it is actually doing.

Thanks!

EDIT: The difference between this question and the one that this question allegedly "duplicates" is that I cannot simply remove manifests from the files I'm trying to compile.

0

There are 0 answers