Error MSB6006: “mt.exe” exited with code 31

后端 未结 11 2147
孤城傲影
孤城傲影 2020-12-15 15:54

I ran into this problem today while migrating a VS2008 solution to VS2010. The problem occurred in either of the following scenarios:

  1. Rebuild Solution
相关标签:
11条回答
  • 2020-12-15 16:29

    Look for an MSB8012 warnings. Likely you have a different output specification for the C++ output value and the Linker Output value.

    0 讨论(0)
  • 2020-12-15 16:30

    I have a project (*.sln) written in visual studio c 8.0. It was migrated to VC10 recently. When I choose the "Release mode", it was compiled sucessfully. But if I choose "Debug mode", the error " MSB6006 mt.exe code 31" happened.

    I found that, in the debug mode, it used a wrong sub-project to startup. After fixing the startup sub-project, it goes fine so far.

    ---- new status --- This won't fix the problem. It just makes the problem disapear temporalily by rebuilding-all. Also, there are other faults caused by the migration. The "resources.h" is missed from the new project and the "winres.rc" is shorten.

    0 讨论(0)
  • 2020-12-15 16:34

    Run VS as administrator. It solved the problem for me.

    0 讨论(0)
  • 2020-12-15 16:34

    Check if you have any anti-virus software like AVG. Exclude the manifest files in the anti-virus software exclusion list.

    0 讨论(0)
  • 2020-12-15 16:39

    In my projects, the Intermediate and Output directories were set to:

    • Intermediate Dir : $(Configuration)\
    • Output Dir : $(SolutionDir)bin\$(Configuration)\

    Under C/C++-->Output Files, I had the following:

    • ASM List Location : $(IntDir)\
    • Object File Name : $(IntDir)\
    • Program Database File Name : $(OutDir)\$(TargetName).pdb

    Under Linker-->Manifest File, I had:

    • Manifest File : $(IntDir)$(TargetName)$(TargetExt).intermediate.manifest

    The cure was to remove the trailing \ from my C/C++-->Output Files section (because it's already part of those variables):

    • ASM List Location : $(IntDir)
    • Object File Name : $(IntDir)
    • Program Database File Name : $(OutDir)$(TargetName).pdb

    Normally, the double-up of using $(IntDir) or $(OutDir) with a trailing \ doesn't seem to cause trouble, even though it's bad practice. I can't remember now whether I did it by accident or if the conversion process did it, but for whatever reason, it seems to have been messing up MT.exe.

    I hope this is useful to anyone else who encounters this problem. Your settings may well be different, but consider that it may be related to improperly formed filenames.

    0 讨论(0)
提交回复
热议问题