QT移植笔记

1.tslib移植和测试
1.1、tslib移植
(1)源码下载
(2)解压        tar -xvf tslib-1.4.tar.gz
(3)配置
# cd tslib
# ./autogen.sh
# echo "ac_cv_func_malloc_0_nonnull=yes">arm-linux.cache 
# mkdir /opt/tslib
# ./configure --prefix=/opt/tslib --host=arm-linux --cache-file=arm-linux.cache
(4)编译和安装
# make
# make install
1.2、问题及解决:
如果./autogen.sh时报错:./autogen.sh: 4: autoreconf: not found,是因为系统中没有安装autoconf工具,解决方法:先让ubuntu能上网,然后执行:sudo apt-get install autoconf automake libtool
1.3、部署
(1)动态库文件so
(2)配置文件
(3)bin文件
1.4、导出环境变量
(2)定义tslib运行需要的环境变量 以下的环境变量导出是放在/etc/profile下
export TSLIB_TSDEVICE=/dev/input/event2
export TSLIB_CALIBFILE=/tslib1.4/etc/pointercal
export TSLIB_CONFFILE=/tslib1.4/etc/ts.conf
export TSLIB_PLUGINDIR=/tslib1.4/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tslib1.4/lib
export TS_INFO_FILE=/sys/class/input/input2/uevent
1.5、运行和测试
(1)错误1:No raw modules loaded.
ts_config: No such file or directory
解决:在etc/ts.conf中打开module raw input这行的注释就行了。

运行测试程序发生Segmentation fault

2、QT5.6.2配置和交叉编译

解压QT5.6.2源码

ar -xvf qt-everywhere-opensource-src-5.6.2.tar.gz

cd qt-everywhere-opensource-src-5.6.2

(1)修改qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf


#sgl added
QT_QPA_DEFAULT_PLATFORM = linuxfb
QMAKE_CFLAGS_RELEASE   += -O2  -march=armv7-a   
QMAKE_CXXFLAGS_RELEASE += -O2  -march=armv7-a
# modifications to g++.conf
QMAKE_CC = arm-linux-gcc -lts
QMAKE_CXX = arm-linux-g++ -lts
QMAKE_LINK = arm-linux-g++ -lts
QMAKE_LINK_SHLIB = arm-linux-g++ -lts
# modifications to linux.conf
QMAKE_AR = arm-linux-ar cqs 
QMAKE_OBJCOPY = arm-linux-objcopy 
QMAKE_NM = arm-linux-nm -P
QMAKE_STRIP = arm-linuxi-strip 

(2)编译前配置(可以参考./configure --help的提示来配置) 比较新的QT版本不支持C++98

./configure  -prefix /opt/QT5.6.2  \
  -opensource  \
  -confirm-license \
  -release  \
  -shared  \
  -accessibility \
-c++std c++98 \
  -xplatform linux-arm-gnueabi-g++ \
-qpa linuxfb \
-linuxfb \
-qreal float \
-pch \
-qt-zlib \
  -qt-libjpeg \
          -qt-libpng \
-no-sse2 \
          -no-largefile \
          -no-qml-debug \
          -no-glib \
-no-gtkstyle \
  -no-opengl \
  -nomake tools \
  -nomake examples \
  -tslib \
  -skip qt3d -skip qtcanvas3d -skip qtdoc -skip qtwayland \
  -I /opt/tslib/include \
  -L /opt/tslib/lib

猜你喜欢

转载自blog.csdn.net/SuGuolin/article/details/85332347
今日推荐