C++ 由于清单不正确,并行配置不正确

C++ 由于清单不正确,并行配置不正确,c++,visual-studio-2010,C++,Visual Studio 2010,我最初是在论坛上问这个问题的,但是进一步的调查表明这更像是一个与C++/Visual Studio相关的一般问题,所以我在这里问这个问题 我正在运行VisualStudioC++ 2010 Express,并将完整的Win32源代码下载到LiBrutk1.1.2。我已经成功地在调试模式下编译了它,没有出现错误或警告,现在正试图让它在我的应用程序中运行,该应用程序构建在SFML1.6之上 我的应用程序对重新编译的libRocket进行编译时没有错误或警告。然而,当我尝试运行它时,我收到一条错误消息

我最初是在论坛上问这个问题的,但是进一步的调查表明这更像是一个与C++/Visual Studio相关的一般问题,所以我在这里问这个问题

<>我正在运行VisualStudioC++ 2010 Express,并将完整的Win32源代码下载到LiBrutk1.1.2。我已经成功地在调试模式下编译了它,没有出现错误或警告,现在正试图让它在我的应用程序中运行,该应用程序构建在SFML1.6之上

我的应用程序对重新编译的libRocket进行编译时没有错误或警告。然而,当我尝试运行它时,我收到一条错误消息,说应用程序无法正确启动(0xc0150002)。单击“确定”关闭应用程序。

使用Dependency Walker打开可执行文件时,出现以下错误:

错误:“ROCKETCORE\u D.DLL”的并排配置信息包含错误。应用程序无法启动,因为其并行配置不正确。

我觉得这很奇怪,因为它还显示了我的应用程序和RocketCore_d.dll,具体取决于MSVCP100D.dll和MSVCR100D.dll。没有错配。然后我执行了一个
sxstrace

=================
Begin Activation Context Generation.
Input Parameter:
    Flags = 0
    ProcessorArchitecture = Wow32
    CultureFallBacks = en-US;en
    ManifestPath = Binaries\Debug\RocketCore_d.dll
    AssemblyDirectory = Binaries\Debug\
    Application Config File = 
-----------------
INFO: Parsing Manifest File Binaries\Debug\RocketCore_d.dll.
    INFO: Manifest Definition Identity is (null).
    INFO: Reference: Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
INFO: Resolving reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
    INFO: Resolving reference for ProcessorArchitecture WOW64.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
               INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.DLL.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    INFO: Resolving reference for ProcessorArchitecture x86.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.DLL.
                INFO: Attempt to probe manifest at Binaries\Debug\Microsoft.VC90.DebugCRT.DLL.
                INFO: Attempt to probe manifest at Binaries\Debug\Microsoft.VC90.DebugCRT.MANIFEST.
                INFO: Attempt to probe manifest at Binaries\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL.
                INFO: Attempt to probe manifest at Binaries\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
   ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
ERROR: Activation Context generation failed.
End Activation Context Generation.
我的系统似乎缺少Visual Studio 2008运行时。这是正确的吗?VS2008可再发行版本的9.0.21022实际上存在于我的系统中。但即便如此,考虑到我使用VS2010重新编译了libRocket,它不应该引用VS2010运行时吗

我认为此错误源于新编译的libRocket清单文件中的配置:

    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b">    </assemblyIdentity>
    </dependentAssembly>

我可以看到它来自哪里,因为应用程序最初是为VS2008编写的,但是如何让VS2010生成正确的清单呢?“项目”属性表示它是自动生成的

请注意,此问题仅在调试模式下发生,在发行版中运行良好。我当然非常希望能够在我的开发人员系统上以调试模式运行它

非常感谢任何关于如何解决此问题的建议

谢谢

它不应该引用VS2010运行时吗

不,VS2010不再将CRT存储在并排缓存中。它已返回c:\windows\system32,无需清单即可找到它。微软在收到太多客户的投诉后改变了主意,这些客户一直在与你所遇到的问题作斗争

这是你的核心问题。您的程序不仅依赖于旧版本的CRT,而且也是错误的版本。CRT的调试版本无法部署,只能在安装了VS2008的计算机上运行。就像你的一样


您肯定需要解决这个问题,混合使用CRT版本可能会导致部署问题之外的更多问题。您正在链接调试配置中使用VS2008构建的.obj或.lib。您需要找到生成该文件的项目并重新生成它,以便它使用正确的配置和CRT版本。如果您没有任何线索,则可以将.obj和.lib文件grep为“DebugCRT”。

问题的解决方案@


只需复制应用程序调试文件夹中版本的DLL和清单文件。

这就解决了问题。结果证明libRocket与FreeType相关联,我认为FreeType是使用VS2008构建的。当我将Rocket与VS2008构建的FreeType连接起来时,我就能够运行我的应用程序了。谢谢你的意思是“…针对VS2010构建的FreeType”你是正确的,只要我将Rocket链接到VS2010构建的FreeType,它就工作了。在某些情况下,这是安装程序错误,并且调试CRT清单条目实际上从“C:\windows\winsxs\manifest”目录中丢失。为了解决这个问题,可以创建一个自定义合并模块安装程序,它将为VisualStudio实际针对的DebugCRT版本生成条目;看看这个答案: