海思QT開發系列(一):Hi3559平臺QT移植

海思QT開發系列(一):3559平臺QT移植

海思QT開發系列(二):構建海思Qt項目Sample

海思QT開發系列(三):Hi3559 Qt Sample開發板運行測試

海思QT開發系列(四):Hi3559 Qt+OpenGL移植

 


參考

  1. 海思Hi3559av100移植Qt5.9.7
  2. Qt5.5.1移植到freescale imx6

網上的版本大都不完善,或多或少會出一些錯誤,所以

一切以我爲準!

環境

主機環境:Ubuntu 16.04;
板端:hi3559av100
交叉編譯環境:aarch64-himix100-linux-
沒環境的同學參考 hisi SDK安裝記錄雖然是3518EV200爲例,但海思sdk都差不多是一個框架,不要慌

下載

本文以最新QT版本5.14.2爲例
qt-everywhere-src-5.14.2.tar.xz

其他QT版本選擇
ps:
用迅雷下載會比較快

移植

解壓

tar xvf qt-everywhere-src-5.14.2.tar.xz

config修改

  • 進入目錄
cd qt-everywhere-src-5.14.2/qtbase/mkspecs/
  • 複製一份aach配置
cp linux-aarch64-gnu-g++/ linux-aarch64-himix100-g++/ -r
  • 修改配置,將qmake.conf文件的編譯器“aarch64-linux-gnu”全部替換爲“aarch64-himix100-linux”
cd linux-aarch64-himix100-g++/
vim qmake.conf


 QT配置,生成Makefile

回到根目錄qt-everywhere-src-5.14.2$/執行:

./configure -release -opensource -confirm-license -make libs -xplatform linux-aarch64-himix100-g++ -prefix $PWD/qt5.9.7_hi3559av100_release -no-opengl -no-ico -strip -shared -nomake examples -no-sse2 -nomake tests -nomake tools -no-iconv 


-no-iconv 去掉字符轉換,不加會有如下錯誤

QIconvCodec::convertToUnicode: using Latin-1 for conversion,iconv_open failed
 QIconvCodec::convertFromUnicode: using Latin-1 for conversion,iconv_open failed
  • -xplatform 代表平臺,注意需要有對應的qmake.conf
  • -prefix 指定安裝目錄
  • -no-iconv
  • -no-ico 不支持圖標、3559不需要,不是單獨的應用
  • -strip 減小體積
  • -shared 動態庫
  • -nomake examples 不編譯example等相關模塊

./configure --help查看其他配置,自行選擇,如果flash有限的話可以慢慢裁剪,3559不需要,哈哈哈哈

編譯

這個沒什麼好說的

make -j$(nproc)
make install

$(nproc) 代表你的核心個數,多核編譯會快一些,如果配置一般,make後建議去喫個飯什麼的

編譯結束

bin 工具相關,下一節會用到
lib
plugins
qml

 

創作不易,歡迎點贊!海星原創,轉載請註明出處!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章