分类: 嵌入式
2015-12-28 22:20:50
git clone git://code.qt.io/qt/qt5.git cd qt5 ./init-repository
2、配置
./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/erain/work/raspberrypi/src/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot /mnt/raspberry-sysroot/ -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /home/erain/work/raspberrypi/src/qt/qt-install -hostprefix /home/erain/work/raspberrypi/src/qt/qt-install 注:
1、交叉编译连使用github上的raspberrypi/tools下面的
2、-sysroot 使用镜像,挂载方法
3、编译安装
make -j4
make install
4、设置qtcreater
5、设置。pro
树莓派环境设置
export QT_ROOT=/home/pi/qt5pi/ export LD_LIBRARY_PATH=$QT_ROOT/lib:$LD_LIBARAY_PATH export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0 export QT_QPA_FONTDIR=$QT_ROOT/lib/fonts export LD_PRELOAD=/usr/lib/preloadable_libiconv.so:$TSLIB_ROOT/lib/libts.so export QT_QPA_GENERIC_PLUGINS=tslib
运行结果