2011年9月29日 星期四

Build 64位元作業系統的應用程式

近來以VC8在開發64位元作業系統的應用程式時遇到了一些問題
問題描述與解決方法如下:
(1) Build出來的Application 無法在64位元的作業系統執行,出現"The application has failed to start because the application configuration is incorrect."


解決方法:更改Project Property為Use MFC in a Static Library.
Project → Property → Configuration Properties → General → Project Defaults → Use of MFC → Use MFC in a Static Library. 如下圖

(2) 執行應用程式時出現 "the application was unable to start correctly (oxc0150002)" 的訊息,這是因為以VC2005或VC2008開發的應用程式,所需的Library未正確地安裝到系統。
只要到Microsoft下載對應的redistributable package,安裝到系統即可。
For VC2005 x86:
Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)

For VC2005 x64:
Microsoft Visual C++ 2005 SP1 Redistributable Package (x64)
For VC2008 x86:
Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)
For VC2008 x64:
Microsoft Visual C++ 2008 SP1 Redistributable Package (x64)

在Vista與Win7 x64上,原本安裝的VC redistributable Package為版本2.0.50727.762,但安裝此版本仍無法讓程式正常啟動,而下載SP1的6.0.3790.0安裝之後即解決問題。

沒有留言:

張貼留言