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

后端 未结 11 2205
孤城傲影
孤城傲影 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: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.

提交回复
热议问题