2011-12-23 46 views
14

我最初在​​3210論壇上問過這個問題,但考慮到進一步的調查顯示這更多的是一般的C++/Visual Studio相關問題,我在這裏問。由於不正確的清單導致並排配置不正確

我正在運行Visual Studio C++ 2010 Express,並已將完整的Win32源代碼下載到libRocket 1.2.1。我已經成功地在調試模式下編譯了它,沒有任何錯誤或警告,現在我正試圖讓它在我的應用程序中運行,該應用程序建立在SFML 1.6之上。

我的應用程序編譯沒有錯誤或警告針對重新編譯的libRocket。當我嘗試運行它,但是,我得到一個錯誤信息說The application was unable to start correctly (0xc0150002). Click OK to close the application.

當我打開我的可執行文件的Dependency Walker,我收到以下錯誤:

Error: The Side-by-Side configuration information for "ROCKETCORE_D.DLL" contains errors. The application has failed to start because its side-by-side configuration is incorrect.

我覺得這奇怪,因爲它也顯示我的應用程序和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到生成正確的清單?項目屬性表明它正在自動生成。

請注意,此問題僅在調試模式下發生,它在發佈時運行得很好。當然,我非常希望能夠在我的開發者系統上以調試模式運行它。

任何關於如何解決這個問題的指針非常感謝!

謝謝!

回答

22

shouldn't it be referencing the VS2010 runtime?

不,VS2010不再將CRT存儲在並排緩存中。它回到了c:\ windows \ system32中,不需要清單來找到它。微軟在收到太多來自客戶的抱怨之後,改變了他們的想法。

<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" .../>

這是您的核心問題。你的程序不僅依賴於老版本的CRT,而且也是錯誤的版本。 CRT的調試版本無法部署,只能在裝有VS2008的機器上運行。像你的。

你肯定需要解決這個問題,混合CRT版本會導致更多的問題超出部署問題。您正在鏈接在Debug配置中使用VS2008構建的.obj或.lib。您需要找到生成該文件的項目並重新構建它,以便使用正確的配置和CRT版本。如果你沒有線索,那麼你可以grep「DebugCRT」的.obj和.lib文件。

您的問題
+0

這茅塞頓開。事實證明,libRocket與FreeType相關聯,我認爲這是使用VS2008構建的。只要我將Rocket與VS2008構建的FreeType連接起來,我就可以運行我的應用程序。謝謝! – Laurens 2011-12-26 21:19:35

+2

您的意思是「...針對VS2010構建的FreeType」 – Schollii 2011-12-28 13:45:13

+0

您是對的,只要我將Rocket與VS2010構建的FreeType鏈接起來,就可以工作。 – Laurens 2012-01-01 11:24:43

-3

解決方案@SideBySide Error

只是DLL和版本的清單文件拷貝到您的應用程序的調試文件夾中。