交叉编译笔记

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

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

相关推荐
tedcloud12312 分钟前
OpenLogi 怎么搭建?用 Rust 打造一个轻量的 Logitech 外设管理工具
linux·运维·服务器·开发语言·后端·rust·开源
Tanjia_kiki30 分钟前
谷歌浏览器中F12编辑并重发请求
开发语言·前端·javascript
程序猿编码32 分钟前
基于GGML的C++17轻量化语音推理引擎:说话人识别与语音分析技术全解析
开发语言·c++·pytorch·深度学习·神经网络·大模型
传奇开心果编程1 小时前
【Rust入门知识点学与练】第5课:函数
开发语言·学习·rust
秋田君1 小时前
Qt_QMediaPlayer类与QMediaPlaylist类
开发语言·qt
统计学小王子1 小时前
数学建模国赛倒计时6天——《软件工具(R语言精讲)》
开发语言·数学建模·r语言
C++ 老炮儿的技术栈1 小时前
Qt5 使用 QPainter 绘制阿基米德螺线
开发语言·c++·windows·qt·代码化
EasyGBS2 小时前
从接入到稳定播放:无插件直播H5视频流媒体播放器EasyPlayer.js如何撑起Web端流媒体
开发语言·前端·javascript
FfHUCisI2 小时前
GMP 调度器:Go 并发的心脏是如何跳动的
开发语言·golang·php
Java小白笔记2 小时前
Java 实现阿里云 OSS 文件上传链路:普通上传、秒传、分片与断点续传
java·开发语言·数据库·spring·阿里云