2012-11-09 43 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可能会有一些有用的指针。