QTCN开发网 -> Qt嵌入式开发 -> 为什么在ARM板上运行程序时,都出现segmentation fault [打印本页]登录 -> 注册 -> 回复主题 -> 发表主题 fiona_hyy2010-09-25 11:15 为什么在ARM板上运行程序时,都出现segmentation fault 环境: PC机是Ubuntu10.04;ARM用S3C2440; 在qt.nokia.com下载的qt-everywhere-opensource-src-4.6.3 友善之臂下载的交叉编译工具arm-linux-gcc-4.4.3和ARM板NFS启动工具rootfs_qtopia_qt4_20100816 GDB调试工具gdb-7.1 (Ubuntu) 用最简单的QT程序HelloWorld,代码如下: # include <QDebug> # include <qwindowsystem_qws.h> # include <QLabel> int main(int argc, char * argv[]) { qDebug() << "Hello! Hello!"; QApplication app(argc, argv, QApplication::GuiServer); qDebug() << "Application starts....."; QLabel hello("Hello World!"); hello.resize(480, 320); hello.show(); return app.exec(); } 在板上运行后显示: Hello! Hello! Segmentation fault 用gdb的backtrace后显示: 0x40198024 in QLinuxFbScreen::useOffscreen()() from /..../libQtGui.so.4 0x4019aadc in QLinuxFbScreen::connect(QString const&) () from /..../libQtGui.so.4 无论运行什么程序,包括demo的都出现同样的结果。 大家有没什么建议啊? fiona_hyy2010-09-25 11:26我的程序的PC机上都运行得很好,但一到ARM上就不行了。大家编程都用哪个版本的Qt/E和arm-linux-gcc啊? chenroby2010-09-27 20:49用4.1.2的编译器编译QtE库,用友善4.3.2的编译QtE库运行应用程序时会出现段错误,我用的QtE4.4.1 ajqwxh2010-10-26 14:47用 eabi-arm920t 就是4.1.2 编译就没有问题啦 所有段错误都可以解决 嘿嘿 nmiirq2010-11-15 16:39QT库的问题,到友善的官网上去多转一转吧 zjhcool2010-11-16 11:33不是Qt 库的问题, 问题原因可能是: 1、framebuffer 未初始化,由于你用到了QWidget 部分,需要用到framebuffer, 因此需要初始化fb 0x40198024 in QLinuxFbScreen::useOffscreen()() from /..../libQtGui.so.4 0x4019aadc in QLinuxFbScreen::connect(QString const&) () from /..../libQtGui.so.4 更说明了这点 2、你的程序是否添加了qws