交叉编译笔记

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

// 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

相关推荐
钟离墨笺3 分钟前
Go语言-->sync.WaitGroup 详细解释
开发语言·后端·golang
小L~~~8 分钟前
Python打造美观的桌面温馨提醒弹窗
开发语言·python
汤姆yu8 分钟前
基于python大数据的特产推荐系统
大数据·开发语言·python
四念处茫茫10 分钟前
仓颉技术:FFI外部函数接口
开发语言·后端·仓颉技术
ColderYY19 分钟前
Python中的正则表达式
开发语言·python·正则表达式
若疆赤云online24 分钟前
SpringGateway处理跨域
java·开发语言
Every exam must be27 分钟前
10.27 JS学习12
开发语言·javascript·学习
雾里云山36 分钟前
pgsql常用函数
java·开发语言·数据库·sql
星期天要睡觉36 分钟前
提示词(Prompt)——链式思维提示词(Chain-of-Thought Prompting)在大模型中的调用(以 Qwen 模型为例)
开发语言·人工智能·python·语言模型·prompt
报错小能手1 小时前
计算机网络自顶向下方法16——应用层 因特网视频 HTTP流和DASH
开发语言·计算机网络·php