前言:本文將介紹Qt5源碼方式的交叉編譯及安裝
下載源碼包:qt-everywhere-src-5.12.8.tar.xz
官網下載網址:Index of /
依次選擇:
【official_releases】 =>【qt】 =>【5.12】 =>【5.12.8】 =>【single】 =>【qt-everywhere-src-5.12.8.tar.xz】
先解壓QT庫壓縮包出來,并進入解壓出來的庫目錄。
接下來請按以下步驟進行:
1. 配置
1.1 配置工具鏈
???????? 配置編譯工具鏈:
$ vi qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf
?
1.2 配置編譯選項
請回到庫的根目錄下操作。
有以下2種情況:
1.2.1 不支持觸摸屏tslib
配置如下:
$ ./configure -prefix /data/arm-linux/libs/qt-5.6.0-arm -opensource -confirm-license -release -make libs -xplatform linux-arm-gnueabi-g++ -pch -sql-sqlite -qt-libjpeg -qt-libpng -qt-zlib -no-opengl -no-sse2 -no-openssl -no-cups -no-glib -no-iconv -no-separate-debug-info -nomake tests -nomake examples -nomake tools -no-pkg-config
配置完成輸出如下:
Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into /data/arm-linux/libs/qt-5.6.0-arm
Prior to reconfiguration, make sure you remove any leftovers from
the previous build.
?1.2.2 支持觸摸屏tslib
若要支持觸摸屏,請先移植觸摸屏tslib,請參考以下博文:
觸摸屏tslib庫交叉編譯并移植ARM校準測試_曾哥電子設計的博客-CSDN博客。
首先添加-tslib項,如tslib安裝在/data/arm-linux/libs/tslib-1.12-arm目錄下,還需通過-I和-L指定include和lib路徑,配置如下:
$ ./configure -prefix /data/arm-linux/libs/qt-5.6.0-arm -opensource -confirm-license -release -make libs -xplatform linux-arm-gnueabi-g++ -pch -sql-sqlite -qt-libjpeg -qt-libpng -tslib -qt-zlib -no-opengl -no-sse2 -no-openssl -no-cups -no-glib -no-iconv -no-separate-debug-info -nomake tests -nomake examples -nomake tools -no-pkg-config -I /data/arm-linux/libs/tslib-1.12-arm/include -L /data/arm-linux/libs/tslib-1.12-arm/lib
?2. 編譯及安裝
?2.1 編譯
執(zhí)行編譯命令:
$ make
Make過程可能發(fā)生以下錯誤:文章來源:http://www.zghlxwxcb.cn/news/detail-404715.html
錯誤1:文章來源地址http://www.zghlxwxcb.cn/news/detail-404715.html
In file included from qtiffhandler
到了這里,關于ubuntu交叉編譯Qt-5庫并移植ARM開發(fā)板的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!