树莓派4B Qt5.14.2 Ubuntu20 交叉编译环境搭建教程 配套资源下载

树莓派4B Qt5.14.2 Ubuntu20 交叉编译环境搭建教程 配套资源下载_第1张图片

视频链接

https://www.bilibili.com/video/BV1dv411Y7ku

firmware

https://github.com/raspberrypi/firmware

sysroot符号连接修复

https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py

Qt5.14.2

https://download.qt.io/archive/qt/5.14/5.14.2/single/qt-everywhere-src-5.14.2.tar.xz

ubuntu20 iso

https://mirrors.163.com/ubuntu-releases/20.04/ubuntu-20.04.1-desktop-amd64.iso

ubuntu20 pi

https://ubuntu.com/download/raspberry-pi/thank-you?version=20.10&architecture=desktop-arm64+raspi

linaro aarch64 GCC7.5

https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz

qmake.conf

#
# qmake configuration for building with aarch64-linux-gnu-g++
#

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

QMAKE_CFLAGS_ISYSTEM = -I
QMAKE_LFLAGS           += -Wl,-rpath-link,$$[QT_SYSROOT]/lib/aarch64-linux-gnu

QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/lib/aarch64-linux-gnu
QMAKE_LIBDIR_EGL        = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBDIR_OPENVG     = $$QMAKE_LIBDIR_OPENGL_ES2

QMAKE_INCDIR_EGL        = $$[QT_SYSROOT]/opt/vc/include \
                          $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads \
                          $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux

QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
QMAKE_INCDIR_OPENVG     = $${QMAKE_INCDIR_EGL}

QMAKE_LIBS_EGL          = -lEGL -lGLESv2
QMAKE_LIBS_OPENVG       = -lEGL -lOpenVG -lGLESv2


# modifications to g++.conf
QMAKE_CC                = aarch64-linux-gnu-gcc
QMAKE_CXX               = aarch64-linux-gnu-g++
QMAKE_LINK              = aarch64-linux-gnu-g++
QMAKE_LINK_SHLIB        = aarch64-linux-gnu-g++

# modifications to linux.conf
QMAKE_AR                = aarch64-linux-gnu-ar cqs
QMAKE_OBJCOPY           = aarch64-linux-gnu-objcopy
QMAKE_NM                = aarch64-linux-gnu-nm -P
QMAKE_STRIP             = aarch64-linux-gnu-strip
load(qt_config)

configure参数

../qt-everywhere-src-5.14.2/configure -opengl es2 -xplatform linux-aarch64-gnu-g++ -device-option CROSS_COMPILE=/opt/aarch64/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- -sysroot /opt/qt5pi/sysroot -prefix /usr/local/qt5pi -opensource -confirm-license -skip qtscript -skip qtdatavis3d -skip macextras -skip declarative -nomake examples -make libs -pkg-config -no-use-gold-linker -v

你可能感兴趣的:(Qt,Linux,树莓派,交叉编译,Qt5,ubuntu,教程)