交叉编译笔记

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

// 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 小时前
【端侧AI 与 C++】1. llama.cpp源码编译与本地运行
开发语言·c++·aigc·llama·agi·ai-native
踢球的打工仔4 小时前
PHP面向对象(7)
android·开发语言·php
汤姆yu6 小时前
基于python的外卖配送及数据分析系统
开发语言·python·外卖分析
Yue丶越6 小时前
【C语言】字符函数和字符串函数
c语言·开发语言·算法
翔云 OCR API6 小时前
人脸识别API开发者对接代码示例
开发语言·人工智能·python·计算机视觉·ocr
V***u4537 小时前
MS SQL Server partition by 函数实战二 编排考场人员
java·服务器·开发语言
这是程序猿7 小时前
基于java的ssm框架旅游在线平台
java·开发语言·spring boot·spring·旅游·旅游在线平台
芳草萋萋鹦鹉洲哦7 小时前
【elemen/js】阻塞UI线程导致的开关卡顿如何优化
开发语言·javascript·ui
爱学习的小邓同学7 小时前
C++ --- 多态
开发语言·c++
颜*鸣&空7 小时前
QT实现串口通信+VSPD+串口调试工具
开发语言·qt