交叉编译笔记

//////////////////////////////////////////////

// cross compile for qt(aarch64-linux)

. download qt source code

https://download.qt.io/archive/qt/

qt-everywhere-opensource-src-5.9.5.tar.xz is source code

qt-opensource-linux-x64-5.9.5.run is for linux

. use command line "apt-get install qt..." install qt at /usr/bin/ /usr/lib/

. build cross compile env

  1. Compilers: add /usr/bin/aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-g++

"which aarch64-linux-gnu-gcc" command give the directory

  1. Qt Versions: add Qt5.9.5(qte-5.9.5) at /opt/qte-5.9.5/bin/qmake

  2. Kits: Name:aarch64, Device type:Generic Linux Device, Compiler C: ARM_GCC C++: ARM_G++

Debuger: none, qt version: Qt5.9.5(qte-5.9.5)

.build qt source file

1)configure qmake at source code qt-5.9.5/qtbase/mkspecs/linux-aarch64-gnu-g++/qmake.conf

add QT_QPA_DEFAULT_PLATFORM = linuxfb, others keep the same

2)configure step

./configure -prefix /opt/qte-5.9.5 \

-opensource \

-confirm-license \

-release \

-shared \

-accessibility \

-c++std c++11 \

-xplatform linux-aarch64-gnu-g++ \

-qpa linuxfb \

-linuxfb \

-qreal float \

-pch \

-qt-libjpeg \

-qt-zlib \

-qt-libpng \

-no-sse2 \

-no-largefile \

-no-qml-debug \

-no-glib \

-no-gtkstyle \

-no-opengl \

-nomake tools \

-nomake examples \

-skip qt3d -skip qtcanvas3d -skip qtdoc -skip qtwayland

3)make&make install

//////////////////////////////////////////////

// cross compile for opencv(aarch64-linux)

.use cmake to configure

1)Specify options for cross-compiling

Operating System=arm-linux

C=/usr/bin/aarch64-linux-gnu-gcc C++=/usr/bin/aarch64-linux-gnu-g++

Target Root=/opt/qte-5.9.5

notice that program mode should be: search in target root, then native system

  1. CMAKE_INSTALL_PREFIX=/home/opencve-2.4.10 CMAKE_FINE_ROOT_PATH=/opt/qte-5.9.5

.go to build_aarch64 file path, use command line to build

make&sudo make install

be careful: 3rdparty like libpng, libjpeg should use -fpic to link, modifies flag.make file

//////////////////////////////////////////////

compile x264(x64-linux)

./configure --enable-shared

make&sudo make install

//////////////////////////////////////////////

compile ffmpeg(x64-linux)

.sdl2 is necessary for ffplay, http://libsdl.org/release/
.x264 is the a good .h264 impelmentation
./configure --enable-shared --enable-swscale --enable-gpl --enable-nonfree
--enable-pic --prefix=/home/ffmpeg --enable-version3 --enable-postproc
--enable-pthreads --enable-x254
make&sudo make install

相关推荐
zcz16071278219 分钟前
LVS + Keepalived 高可用负载均衡集群
java·开发语言·算法
Bellafu66638 分钟前
项目中遇到pom文件里使用systemPath的例子记录
开发语言
爱喝水的鱼丶1 小时前
SAP-MM:SAP采购组织全面学习指南:从概念到实战配置图解
运维·开发语言·数据库·学习·sap·mm模块·采购组织
楼田莉子1 小时前
Python学习——字典和文件
开发语言·python·学习·pycharm
知彼解己1 小时前
字符串大数相加:从初稿到优化的思路演进
java·开发语言·算法
好多171 小时前
《JVM如何排查OOM》
开发语言·jvm·python
学计算机的1 小时前
Python:OpenCV 教程
开发语言·python
拾忆,想起1 小时前
Redisson 分布式锁的实现原理
java·开发语言·分布式·后端·性能优化·wpf
大阳1232 小时前
51单片机4(温度传感器DS18B20)
开发语言·单片机·嵌入式硬件·算法·51单片机
北城以北88882 小时前
Java高级编程--XML
xml·java·开发语言·intellij-idea