【问题标题】:Need insight into how manifest is being generated for C++ program需要深入了解如何为 C++ 程序生成清单
【发布时间】:2010-02-09 05:50:36
【问题描述】:

当我运行我构建的可执行文件时,我收到以下错误:

系统无法执行指定的程序

我的直接想法是,这是 VC8.0 可再分发 DLL 之一(msvcr80d.dll 等)的依赖性问题。这些 DLL 的补丁版本会影响我们的程序,我们遇到了一些问题。

当我在 Dependency Walker 下打开我的可执行文件时,显示以下错误:

Error: The Side-by-Side configuration information in "w:\MYPROGRAM.EXE.manifest" 
       contains errors. This application has failed to start because the
       application configuration is incorrect. Reinstalling the application may
       fix this problem (14001).
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export
         function in a delay-load dependent module.

如果我打开可执行文件的清单文件,其中包含以下内容:

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50727.4053' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
  </dependency>
</assembly>

其中似乎有 2 个 Microsoft.VC80.DebugCRT 依赖程序集的副本。

8.0.50727.4053 版本的程序集不在我的并行配置中(我相信此版本附带未安装的 Visual Studio 补丁)。

如果我从清单文件中删除此程序集,则可执行文件运行良好。

但是,当我重新构建应用程序时,会重新生成清单并再次添加额外的依赖项。

是什么导致此依赖项添加到清单中?我猜它与另一个 DLL 有关,我的应用程序依赖于在另一台 PC 上构建,具有不同的可再分发 DLL 集,但我想确认这一点。

更新:

我尝试了this blog post 中的很多建议,但运气不佳。奇怪的一件事是,当我进行 Release 构建时生成的清单不包含 8.0.50727.4053 条目,但 Debug 构建包含。

【问题讨论】:

  • 您是在 FAT 还是 FAT32 文件系统上构建项目?
  • VS2005 在 FAT/FAT32 上存在一个已知问题。尝试在项目设置中启用“使用 FAT32 解决方法”之类的想法。清单工具->常规。
  • 抱歉,不知道为什么我说它是 FAT32。它是 NTFS(标准 Windows XP)。

标签: c++ windows manifest side-by-side dll


【解决方案1】:

你是对的。 Visual C++ 2005 SP1 的安全更新强制您的应用使用较新版本的 CRT 和 MFC(8.0.50727.4053 而不是 8.0.50727.762)。因为它可能兼容,所以最好使用新的。您还应该与您的应用一起分发 vcredist_x86.exe。

就像我现在一样,VS C++ 不会扫描依赖项,因此清单是从核心 VS 生成的(您可以通过项目设置手动控制它)。我认为 VS 更新已安装在开发 PC 上,因此 VS 将其反映在清单中。

【讨论】:

  • 这并没有真正回答他的问题:为什么 VS 将两个版本都添加到清单中
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-01-30
  • 1970-01-01
相关资源
最近更新 更多