2008-11-05 56 views
7

我們將Visual C++ 2003解決方案移至Visual 2005,現在我們在部署到清理XP機器時遇到問題。應用程序未能啓動...應用程序配置不正確 - VC++ 2005運行時問題

我們的解決方案有一個DLL項目和一個使用此DLL的命令行可執行文件。這兩個項目都創建並嵌入清單文件。

我們的安裝程序還將VC8 CRT運行時從C:\ Program \ Microsoft Visual Studio 8 \ VC \ redist \ x86 \ Microsoft.VC80.CRT \複製到安裝目錄。

當我們安裝在乾淨的Windows XP上時,我們看到錯誤消息「應用程序未能啓動...應用程序配置不正確。」

把exe文件了Depends.exe,說:

Error: The Side-by-Side configuration information for "c:\program files\MySoftware\vc8\BENCHMARK.EXE" contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001). 
Error: The Side-by-Side configuration information for "c:\program files\MySoftware\vc8\MYLIB-VC8.DLL" 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 module has an unresolved import due to a missing export function in a delay-load dependent module. 

事件查看器日誌:

Dependent Assembly Microsoft.VC80.CRT could not be found and Last Error was The referenced assembly is not installed on your system. 

Resolve Partial Assembly failed for Microsoft.VC80.CRT. Reference error message: The referenced assembly is not installed on your system. 

Generate Activation Context failed for C:\Program Files\MySoftware\vc8\Benchmark.exe. Reference error message: The operation completed successfully. 

我讀過複製msvcp80.dll,MSVCR80.DLL,msvcm80.dll和Microsoft.VC80.CRT.manifest到應用程序文件夾就足夠了。

我在做什麼錯?

回答

5

不推薦複製CRT dll。正如Vinay說你應該使用正確的合併模塊。

您還可以使用的REDIST如果合併模塊不與您的安裝技術合作安裝的exe:

作爲最後的手段嘗試複製整個「 Microsoft.VC80.CRT'目錄到你的程序的exe目錄(不是內容,實際目錄)。

2

在安裝程序中選擇Visual Studio 2005合併模塊。 如果您使用安裝了Service Pack的Visual Studio構建了exe/dll,也會發生這種情況。

+0

我想這不是一個選項,因爲我們使用Innosetup作爲我們的安裝程序。 – 2008-11-07 12:41:02

2

我也有這個問題。我對微軟這樣對我們感到震驚。 (我使用VC6來構建一個特定的項目,然後當我在構建機器上安裝了2003和2005時,它導致我的VC6構建出現問題(我沒有在原始機器上檢查安裝)顯然,鏈接器/編譯器不知道它在做什麼,所以它導致了我的可分發問題,然後我不得不添加一個巨大的redist安裝文件到我的120k EXE應用程序中。

http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en

4

你並不真的需要微軟的VC80 C運行時庫。這是一個爛攤子。

相反,用/ MT選項重新鏈接你的程序,這個靜態鏈接c運行時庫(libcmt.lib)或C++標準庫。要通過項目屬性設置,請轉到

C/C++ -> Code Generation -> Runtime Library: Multi-threaded (/MT) 

如果不能編譯,您可能希望增加該選項以及(/ NODEFAULTLIB :)

Linker -> Input -> Ignore Specific Library: msvcrt.lib 

請參閱從鏈接選項http://msdn.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx

相關問題