参见:http://apps.hi.baidu.com/share/detail/22897969
1、配置directfb的环境变量
export PKG_CONFIG_PATH=/home/yanxu/DirectFB-1.4.0:/home/yanxu/DirectFB-1.4.0/lib/fusion:/home/yanxu/DirectFB-1.4.0/lib/direct
2、修改qt相关平台的qmake.conf文件,添加:
QT_CFLAGS_DIRECTFB = -D_REENTRANT -I/usr/local/Trolltech/DirectFB_1.4_forx11/include/directfb
QT_LIBS_DIRECTFB = -L/usr/local/Trolltech/DirectFB_1.4_forx11/lib -ldirectfb -lfusion -ldirect -lpthread
上面变量的value值:
root@ubuntu:~/qt-embedded-linux-opensource-src-4.5.3# pkg-config --libs directfb
-L/usr/local/Trolltech/DirectFB_1.4_forx11/lib -ldirectfb -lfusion -ldirect -lpthread
root@ubuntu:~/qt-embedded-linux-opensource-src-4.5.3# pkg-config --cflags directfb
-D_REENTRANT -I/usr/local/Trolltech/DirectFB_1.4_forx11/include/directfb
3、./configure -prefix /usr/local/Trolltech/Qt_4_5_3_embed_x86_directfb -embedded x86 -xplatform qws/linux-x86-g++ -plugin-gfx-directfb
4、make
5、make install
6、添加qws配置文件$HOME/.directfbrc,全局的,内容如下:
system=x11
mode=800x600
pixelformat=ARGB
7、 /examples/painting/basicdrawing/basicdrawing -qws -display directfb