分享

Microsoft.CppCommon.targets(574,5): error MSB6006: "mt.exe" exited with code 31.解决办法

 昵称597197 2014-09-29

一、问题出现

  用VS编译动态库dll文件的时候,ReBuild过程中会遇到Microsoft.CppCommon.targets(574,5): error MSB6006: "mt.exe" exited with code 31.这个问题,略坑爹啊,找了半天都是英文的解决办法,也没解释清楚,于是记录分享。

具体错误如下

  1. 1>  Generating code  
  2. 1>  Finished generating code  
  3. 1>  myRecast1.vcxproj -> C:\Users\Lufeng\Documents\Visual Studio 2010\Projects\myRecast1\x64\Release\recast.dll  
  4. 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(574,5): error MSB6006: "mt.exe" exited with code 31.  
  5. 1>  
  6. 1>Build FAILED.  
  7. 1>  
  8. 1>Time Elapsed 00:00:01.57  
  9. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========  


二、解决办法

  设置project的属性Manifest Tool,把 "Embed Manifest" 设置成No,具体操作如图:


  这样就能正常编译了,ReBuild再多次都不会报错了。。


三、问题原因

  具体问题原因如下,和manifest有关。

According to Microsoft's documentation, Mt.exe is "a tool that generates signed files and catalogs". Mt.exe is used in the manifest generation process. If you don't know what a manifest is,further documentation explains: "A manifest is an XML document that can be an external XML file or a resource embedded inside an application or an assembly. The manifest of an isolated application is used to manage the names and versions of shared side-by-side assemblies to which the application should bind at run time. The manifest of a side-by-side assembly specifies its dependencies on names, versions, resources, and other assemblies."

  具体翻译就是:根据微软的文档,MT.EXE是“生成签名的文件和目录的工具”。 MT.EXE采用的是清单生成过程。如果你不知道什么是明显的是,更多的文档解释说:“manifest 是一个 XML 文档,可以是外部 XML 文件,也可以是嵌入应用程序或程序集内的资源。isolated application 的清单用于管理该应用程序在运行时应该绑定到的共享并行程序集的名称和版本。side-by-side assembly 的清单指定该程序集在名称、版本、资源和其他程序集上的依赖项。“


全文完。。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多