明远智睿技术论坛
标题: 移植QT库5.5.1 [打印本页]
作者: myzr_soft 时间: 2019-12-2 17:36
标题: 移植QT库5.5.1
本帖最后由 myzr_soft 于 2020-1-2 08:39 编辑
主机平台: UBUNTU14.04
硬件平台:明远智睿MY-IMX6-EK200-6Q-1G
内核版本 :linux-4.1.15
交叉编译链:arm-linux-gnueabihf
文件系统:L4115-core-image-base-myimx6a9.tar.bz2
下载:
tslib:[attach]575[/attach]
配置交叉工具:
$ export PATH=/home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/PATH
创建工作目录及解压:
$ mkdir Qt
$ mv tslib-master.zip Qt
$ mv qt-everywhere-opensource-src-5.5.1.tar.gz Qt
$ cd Qt/
$ unzip tslib-master.zip
$ tar xf qt-everywhere-opensource-src-5.5.1.tar.gz
$ mkdir tslib-install
编译tslib(X86):
$ cd tslib-master
$ ./autogen.sh
$ ./configure
$ make
$ make install
编译tslib(arm):
$ make distclean
$ ./autogen.sh
$ ./configure --host=arm-linux-gnueabihf --prefix /home/myzr/Qt/tslib-install/ CC=arm-linux-gnueabihf-gcc
$ make
$ make install
编译qt库:
$ cd ..
$ cd qt-everywhere-opensource-src-5.5.1
$ cd qtbase/mkspecs/
$ cp linux-arm-gnueabi-g++/ linux-arm-poky-gnueabi-g++/ -r
$ cd linux-arm-poky-gnueabi-g++/
$ vi qmake.conf
修改交叉工具链路径,且在QMAKE_CC、QMAKE_CXX、QMAKE_LINK、QMAKE_LINK_SHLIB后加上-lts:
QMAKE_CC = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -lts
QMAKE_CXX = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -lts
QMAKE_LINK = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -lts
QMAKE_LINK_SHLIB = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf -lts
# modifications to linux.conf
QMAKE_AR = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-objcopy
QMAKE_NM = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-nm -P
QMAKE_STRIP = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip
[attach]576[/attach]
$ cd ~/Qt/qt-everywhere-opensource-src-5.5.1
$ vi qtbase/mkspecs/common/linux.conf
QMAKE_LIBS_THREAD = -lpthread 后加上-lts
即: QMAKE_LIBS_THREAD = -lpthread -lts
[attach]577[/attach]
$ sudo ./configure -prefix /usr/local/qte5.5.1 -release -opensource -no-accessibility -make libs -xplatform linux-arm-poky-gnueabi-g++ -optimized-qmake -pch -qt-sql-sqlite -qt-zlib -tslib -no-opengl -no-sse2 -no-openssl -no-nis -no-cups -no-glib -no-pkg-config -no-separate-debug-info -tslib -I/home/myzr/Qt/tslib-install/include -L/home/myzr/Qt/tslib-install/lib
$ sudo make
$ sudo make install
安装目录为/usr/local/qte5.5.1 可将这个文件移植到开发板相同的目录
将 tslib-install 移植到开发板的 /usr/local 目录下
# vi /usr/local/tslib-install/etc/ts.conf
"#module_raw input"把前面的#去掉
[attach]626[/attach]
# vi /etc/profile
加上:
export T_ROOT=/usr/local/tslib-install
export LD_LIBRARY_PATH=/usr/local/tslib-install/libLD_LIBRARY_PATH export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
export TSLIB_CONFFILE=$T_ROOT/etc/ts.conf
export POINTERCAL_FILE=/etc/pointercal
export TSLIB_CALIBFILE=/etc/pointercal
export QTEDIR=/usr/local/qte5.5.1
export LD_LIBRARY_PATH=/usr/local/qte5.5.1/libLD_LIBRARY_PATH export QT_QPA_GENERIC_PLUGINS=tslib
export QT_QPA_FONTDIR=$QTEDIR/lib/fonts
export QT_QPA_PLATFORM_PLUGIN_PATH=$QTEDIR/plugins
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:size=800x480:mmSize=800x480ffset=0x0:tty=/dev/tty1 export QT_QPA_FB_TSLIB=1
if [ -f /etc/pointercal ];then
echo "MXS touchscreen have calibrate!"
else
/usr/local/tslib-install/bin/ts_calibrate
sync
fi
[attach]627[/attach]
作者: shkhlove 时间: 2019-12-30 16:35
qmetaobjectpublisher.cpp:44:20: fatal error: QJSValue: No such file or directory
compilation terminated.
make[3]: *** [.obj/qmetaobjectpublisher.o] 错误 1
make[3]:正在离开目录 `/home/myzr/Qt/qt-everywhere-opensource-src-5.5.1/qtwebchannel/src/webchannel'
make[2]: *** [sub-webchannel-make_first] 错误 2
make[2]:正在离开目录 `/home/myzr/Qt/qt-everywhere-opensource-src-5.5.1/qtwebchannel/src'
make[1]: *** [sub-src-make_first] 错误 2
我编译之后出现这个问题, UBUNTU12.04.5
作者: myzr_soft 时间: 2019-12-31 10:19
$ sudo ./configure -prefix /usr/local/qte5.5.1 -release -opensource -no-accessibility -make libs -xplatform linux-arm-poky-gnueabi-g++ -optimized-qmake -pch -qt-sql-sqlite -qt-zlib -tslib -no-opengl -no-sse2 -no-openssl -no-nis -no-cups -no-glib -no-pkg-config -no-separate-debug-info -tslib -I/home/myzr/Qt/tslib-install/include -L/home/myzr/Qt/tslib-install/lib 使用这个配置来编译试试
作者: shkhlove 时间: 2019-12-31 20:20
之前是按参数编译的,发现编译错误前面还有权限警告,我用sudo make,现在可以了@myzr_soft, 谢谢
欢迎光临 明远智睿技术论坛 (http://bbs.myzr.com.cn/) |
Powered by Discuz! X3.2 |