平台
windows 7 + mingw gcc 4.4 + qt 4.8.4。
我的程序相当简单,使用mingw32-make生成的debug可
执行文件可以运行正常。gdb一
调试就出
段错误,
界面可以出来,但是
按钮上的“hello!"不见了。小弟QT新手,求指点。代码如下:
#include <QApplication>
#include <QPushButton>
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QPushButton* mw = new QPushButton();
mw->setText("hello!");
mw->show();
return app.exec();
}
gdb调试的输出:
I:\qt_rio\sample\debug>gdb sample.exe
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) r
Starting program: I:\qt_rio\sample\debug/sample.exe
[New thread 2184.0x1464]
[New thread 2184.0xb24]
Program received signal SIGSEGV, Segmentation fault.
0x0d1d29b5 in winhafnt!UninstallDetours ()
from C:\Windows\system32\winhafnt.dll
(gdb) q
The program is running. Exit anyway? (y or n) y