1:配置脚本
因linux和windows格式配置不一样,复制进去会报错,直接在linux vim 手打
#!/bin/sh
./configure -prefix /opt/qt5.9 \
-opensource \
-debug \
-confirm-license \
-xplatform linux-arm-gnueabi-g++ \
-no-opengl \
-no-pch \
-shared \
-no-iconv \
-no-xcb \
2:qmake.conf
#
# qmake configuration for building with arm-linux-gnueabi-g++
#
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
# modifications to g++.conf
QMAKE_CC = arm-linux-gnueabihf-gcc -lts
QMAKE_CXX = arm-linux-gnueabihf-g++ -lts
QMAKE_LINK = arm-linux-gnueabihf-g++ -lts
QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++ -lts
# modifications to linux.conf
QMAKE_AR = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
QMAKE_NM = arm-linux-gnueabihf-nm -P
QMAKE_STRIP = arm-linux-gnueabihf-strip
load(qt_config)
QMAKE_INCDIR = /opt/tslib/include
QMAKE_LIBDIR = /opt/tslib/lib
3:移植到ARM开发板
在上面我们通过configure 、make、 make install讲库文件安装到了/opt/qt5.9
把/opt/qt5.9 里面的 lib plugins 拷贝到ARM开发板的/usr/local/qt5.9.6
qt5.9是不带字体库的需要我们自己复制一份过去
在这里我把qt4.8里面的 fonts 拷贝到/usr/local/qt5.9.6/lib/fonts
4:ARM开发板配置环境
wr vi /etc/profile
# Qt qwx config
export LD_LIBRARY_PATH=/usr/local/qt5.9.6/lib
export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/local/qt5.9.6/plugins
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0
export QT_QPA_FONTDIR=/usr/local/qt5.9.6/lib/fonts
5Qtcreator 配置
编译器需要配置C++ 和 Gcc 不然会报错
来源:CSDN
作者:ICEDustpan
链接:https://blog.csdn.net/weixin_44205779/article/details/104844662