我想把QT4.4.3移植到mips系统下,编译没有错误
但是运行qt程序显示出蓝屏,看不到GUI界面.
编译过程
1
#./configure -prefix /usr/local/Trolltech/QtEmbedded-4.4.3-mips1 -fast -no-largefile -nomake examples -nomake demos -webkit -silent -platform qws/linux-x86-g++ -xplatform qws/linux-mips-g++ -embedded mips -little-endian -depths all -qt-gfx-linuxfb -qt-kbd-tty -qt-mouse-pc 2>../configure.error
生成的报告的部分摘录
result:
Graphics (qt) ....... linuxfb multiscreen linuxfb
Graphics (plugin) ...
Decorations (qt) .... styled windows default
Decorations (plugin)
Keyboard driver (qt). tty tty
Keyboard driver (plugin)
Mouse driver (qt) ... pc linuxtp pc
Mouse driver (plugin)
OpenGL support ...... no
2.
#gmake 2>gmake.error
#gmake install
gmake产生了一些警告,可以参看附件.
设置如下
mips系统(目标) 172.16.1.228
x86系统(安装QT的系统) 172.16.1.225
然后在mips的系统上设置如下
#mount -t nfs -o nolock 172.16.1.225:/ /mnt/
设置环境变量
#uclibc[Trolltech]# sourceqte-mips-stb.sh
#uclibc[Trolltech]# cat qte-mips-stb.sh
#!/bin/sh
QT=/mnt/usr/local/Trolltech
ln -s $QT /usr/local/Trolltech
QTE=/mnt/usr/Trolltech/QtEmbedded-4.4.3-mips1
export LD_LIBRARY_PATH=$QTE/lib
export PATH=$QTE/bin:$PATH
#我不知道是不是QWS_DISPLAY变量的原因,但是在x86下编译的qte运行时并没有设置这个变量,也能正常运行.
#export QWS_DISPLAY="LinuxFb:0"
在x86的机器上设置好samba和nfs
设置环境变量
# source QtEmbedded-4.4.3-mips1.sh
# cat QtEmbedded-4.4.3-mips1.sh
#!/bin/bash
#/usr/local/Trolltech/QtEmbedded-4.4.3-mips1
export QTDIR=/usr/local/Trolltech/QtEmbedded-4.4.3-mips1
export QTINC=$QTDIR/include
export QTLIB=/$QTDIR/lib
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
测试程序如下
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.show();
return app.exec();
}
开发工具链是别人编译好的,我就不贴了.
测试结果如下,没有GUI页面的话,QT是能正常跑的,比如执行一个QT的定时器.
存在GUI界面的话,屏幕先显示一个鼠标,然后显示出蓝屏,但是看不到GUI界面.
uclibc[t1]# ./t1 -qws &
809
uclibc[t1]# mambolfb_mmap: OSD videomemory asked:0x1786ac00
mambolfb_mmap remapped 1658880 bytes in userland of process 809 at address vma_start0x2bbc6000 to phys=0x1786ac00
proc目录下面的maps文件可以见附录
mips系统的framebuffer设备是没有问题的,我执行了QT的fb测试程序确认过.