问题描述
尝试创建QApplication
对象时出现崩溃.这是我的代码:
I get a crash when try to create a QApplication
object. This is my code:
#include <QLabel>
#include <QApplication>
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
return app.exec();
}
我正在使用Qt版本4.8.4和MinGW编译器.运行QCoreApplicationPrivate::processCommandLineArguments
方法时,我的应用程序崩溃.有人可以告诉您如何解决这个问题吗?
I am using Qt version 4.8.4 and the MinGW compiler. My application crashes when running QCoreApplicationPrivate::processCommandLineArguments
method. Can anybody tell how to solve this problem?
推荐答案
显然,此错误是由Qt二进制文件与您的编译器的二进制不兼容引起的.
Apparently, this error is caused by binary incompatibility of Qt binaries and your compiler.
从此处:
如果您使用的是gcc 4.7(我认为这是具有最新MinGW的默认版本),则无法编译(嗯,可以,但是它不适用于Qt 4预编译的二进制文件.
If you are using gcc 4.7 (I think this is the default version with the latest MinGW), you can't compile (well, you can, but it will not work) with Qt 4 precompiled binaries.
因此,您可以将gcc降级到4.4版本,或者将Qt升级到最新(Qt 5)版本.
So, either downgrade your gcc to 4.4 version, or upgrade Qt to latest (Qt 5) version.
这篇关于Q应用程序分割错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!