2012-11-09 160 views
1

我使用的是Qt 4.8.3 mingw 4.7 Windows 7 x64。 exe文件不起作用..qt exe文件不運行

Problem signature: 
    Problem Event Name: APPCRASH 
    Application Name: hello.exe 
    Application Version: 0.0.0.0 
    Application Timestamp: 509d1749 
    Fault Module Name: QtCore4.dll 
    Fault Module Version: 4.8.3.0 
    Fault Module Timestamp: 504ee1c2 
    Exception Code: c0000005 
    Exception Offset: 001103e8 
    OS Version: 6.1.7601.2.1.0.256.4 
    Locale ID: 1067 
    Additional Information 1: 0a9e 
    Additional Information 2: 0a9e372d3b4ad19135b953a78882e789 
    Additional Information 3: 0a9e 
    Additional Information 4: 0a9e372d3b4ad19135b953a78882e789 

這裏是非常簡單的源代碼:

#include <QApplication> 
#include <QLabel> 

int main(int argc, char *argv[]) 
{ 
    QApplication app(argc, argv); 
    QLabel *label = new QLabel("Hello Qt!"); 

    label->show(); 

    return app.exec(); 
} 
+0

您是否嘗試調試您的應用程序? – Synxis

+0

只有在嘗試手動啓動exe時纔會發生這種情況嗎?從Qt Creator中運行它時它工作嗎? –

+0

Sinxis vs 2012在hello.exe中0x86E1D03E8(QtCore4.dll)表示未處理異常:0xC0000005:訪問衝突讀取地址0x01040807。 – user1740587

回答

3

,你可以從qt-project.org下載Qt的4.8.3 MinGW的圖書館建與MinGW 4.4。如果您正在使用該庫,嘗試使用MinGW 4.7時會遇到問題。

MinGW 4.7.0 changed the default calling convention for C++ class members to __thiscall,所以使用MinGW 4.7.0或更高版本構建的C++程序與使用早期版本的MinGW構建的庫或對象文件不兼容。有關更多詳細信息,請參見https://stackoverflow.com/a/13134812/12711

您需要使用較舊版本的MinGW(理想情況下爲4.4),否則需要使用您正在使用的MinGW版本重建Qt庫。如果你嘗試重建Qt並遇到問題,this SO answer可能會有一些有用的指針。