交叉编译笔记

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

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

相关推荐
fs哆哆2 小时前
在VB.net中一维数组,与VBA有什么区别
java·开发语言·数据结构·算法·.net
johnZhangqi2 小时前
深圳大学-计算机信息管理课程实验 C++ 自考模拟题
java·开发语言·c++
Sally璐璐2 小时前
Go语言变量声明与初始化详解
java·开发语言·golang
StudyWinter3 小时前
【C++】仿函数和回调函数
开发语言·c++·回调函数·仿函数
C4程序员3 小时前
北京JAVA基础面试30天打卡14
java·开发语言·面试
黑客影儿4 小时前
Go特有的安全漏洞及渗透测试利用方法(通俗易懂)
开发语言·后端·安全·web安全·网络安全·golang·系统安全
你好,我叫C小白4 小时前
C语言 常量,数据类型
c语言·开发语言·数据类型·常量
小红帽2.05 小时前
从ioutil到os:Golang在线客服聊天系统文件读取的迁移实践
服务器·开发语言·golang
Zafir20246 小时前
Qt实现TabWidget通过addTab函数添加的页,页内控件自适应窗口大小
开发语言·c++·qt·ui