树莓派安装Ubuntu22.04后使用X86_Linux交叉编译Qt5+opencv4

2023-10-27

准备工作

  1. 树莓派安装Ubuntu,直接从官网下载对应的镜像烧写工具下载地址,工具里面准备好了对应的镜像地址,直接烧写入SD卡就行了
  2. 进入系统,ubuntu-server22.04默认密码应该是ubuntu,账号和密码一样
  3. 更新源,安装必要的库,如果网速不行的话简易更换源,需要注意,树莓派是arm架构,对应的源应该是ubuntu-ports,个人觉得没有必要换,官方的源网速也很快了
    在这里插入图片描述
    点击旁边的问号可以看到使用帮助
    在树莓派上执行下列命令:
1	sudo apt update

安装qt运行环境Ubuntu22前应该是qt5-default,22可以安装qtbase5-dev
2  sudo apt install qt5-default  #或者
   sudo apt install qtbase5-dev
安装opengl运行环境
因为安装的是Ubuntu,所以参照Ubuntu安装OpenGL环境就可以了
https://blog.csdn.net/qq_40520596/article/details/111663646

在X86的Linux执行下列命令

sudo apt update #更新源
apt-cache search aarch64# 查看可以安装的版本,树莓派是aarch64架构
sudo apt install gcc-9-aarch64-linux-gnu#选择一个版本进行下载
sudo apt install g++-9-aarch64-linux-gnu
sudo apt --fix-broken install#安装依赖

此时应该可以在/usr/bin目录下看到aarch64-linux-gnu-gcc-9和对应的g++-9
不想要后面的-9可以复制一份改名或者建立一个链接
树莓派需要和X86电脑建立网络连接

  1. 在X86_Linux电脑上下载opencv源码并解压
  2. 在X86_Linux电脑上下载QT源码并解压

环境搭建

  1. 同步根文件目录
    mkdir在X86的Linux上创建一个根文件目录 (记住这个目录)
mkdir ~/sysroot-raspi
  1. 从树莓派上同步其根文件系统
    在X86的Linux:
cd ~/sysroot-raspi  #进入刚刚建立好的根文件目录
rsync -avz 树莓派用户名@树莓派的ip:/lib  ./   将lib目录同步
mkdir ~/sysroot-raspi/usr   #建立并同步usr目录
rsync -avz 树莓派用户名@树莓派的ip:/usr/lib  ./usr
rsync -avz 树莓派用户名@树莓派的ip:/usr/include ./usr#

最后处理库之间的连接关系
cd ~
pyhton sysroot-relativelinks.py sysroot-raspi#这个参数是根文件目录名称

sysroot-relativelinks.py内容如下

#!/usr/bin/env python
import sys
import os

# Take a sysroot directory and turn all the abolute symlinks and turn them into
# relative ones such that the sysroot is usable within another system.

if len(sys.argv) != 2:
    print("Usage is " + sys.argv[0] + "<directory>")
    sys.exit(1)

topdir = sys.argv[1]
topdir = os.path.abspath(topdir)

def handlelink(filep, subdir):
    link = os.readlink(filep)
    if link[0] != "/":
        return
    if link.startswith(topdir):
        return
    #print("Replacing %s with %s for %s" % (link, topdir+link, filep))
    print("Replacing %s with %s for %s" % (link, os.path.relpath(topdir+link, subdir), filep))
    os.unlink(filep)
    os.symlink(os.path.relpath(topdir+link, subdir), filep)

for subdir, dirs, files in os.walk(topdir):
    for f in files:
        filep = os.path.join(subdir, f)
        if os.path.islink(filep):
            #print("Considering %s" % filep)
            handlelink(filep, subdir)

至此,根文件目录搭建完成,我们便在X86的电脑上拥有了对应和树莓派一样的文件环境


准备编译

进入Qt源码目录
以下命令均在X86_Linux下运行

cd QT解压目录/qt-everywhere-src-5.15.8#进入Qt源码目录
mkdir build		#建立一个build目录并cd进入
cd build
sudo vim ../qtbase/mkspecs/linux-aarch64-gnu-g++/qmake.conf#编辑对应的CMake规则文件

我的qmake.conf文件,根据自己的情况调整

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

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

QT_QPA_DEFAULT_PLATFORM=linuxfb#可以改为eglfs
QMAKE_CFLAGS_RELEASE += -O2 -march=armv8-a -lts
QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv8-a -lts

sysroot=/home/lhh/sysroot-raspi

QMAKE_INCDIR_OPENGL[_ES2] += ${sysroot}/usr/include

QMAKE_LIBDIR_OPENGL[_ES2] += ${sysroot}/usr/lib/aarch64-linux-gnu

QMAKE_INCDIR_EGL += $$QMAKE_INCDIR_OPENGL[_ES2]
QMAKE_LIBDIR_EGL += $$QMAKE_LIBDIR_OPENGL[_ES2]

QMAKE_INCDIR_OPENVG += $$QMAKE_INCDIR_OPENGL[_ES2]
QMAKE_LIBDIR_OPENVG += $$QMAKE_LIBDIR_OPENGL[_ES2]

QMAKE_LIBS_EGL         += -lEGL
QMAKE_LIBS_OPENGL_ES2  += -lGLESv2 -lEGL

EGLFS_DEVICE_INTEGRATION = eglfs_kms
# modifications to g++.conf
#这里,如果你的编译器和我一样是aarch64-linux-gnu-gcc-9,那这后面全部加一个-9
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)

配置完qmake后,重新进入Qt源码目录下新建立的build文件夹

cd QT解压目录/qt-everywhere-src-5.15.8/build
touch autoconfig.sh# 建立一个build脚本并且赋予执行权限
sudo chmod u+x autoconfig.sh

我的autoconfig.sh文件

#!/bin/sh
rm config.cache
mysysroot=/home/lhh/sysroot-raspi

../configure \
-opengl es2 \
-no-feature-eglfs_brcm \  #这条需要加上,不然编译报错,我在网上看到的,具体为啥不知道
-xplatform linux-aarch64-gnu-g++ \
-device-option CROSS_COMPILE=/usr/bin/aarch64-linux-gnu-g++ \ #交叉编译器路径
-sysroot ${mysysroot}  \
-extprefix /opt/qt-5.18-aarch64 \  #安装路径,如果设置prefix,则最终安装在sysroot/的子目录下
-opensource \
-confirm-license \
-skip qtscript \
-skip qtdatavis3d \
-nomake examples \
-make libs \
-xcb \
-tslib \
-pch \
-skip webengine \
-recheck-all \
-pkg-config \
-no-use-gold-linker -v

在源码目录下输入configure -h可以编译选项的解释,这里贴出来

Top-level installation directories:
  -prefix <dir> ...... The deployment directory, as seen on the target device.
                       [/usr/local/Qt-$QT_VERSION; qtbase build directory if
                       -developer-build]
  -extprefix <dir> ... The installation directory, as seen on the host machine.
                       [SYSROOT/PREFIX]
  -hostprefix [dir] .. The installation directory for build tools running on
                       the host machine. If [dir] is not given, the current
                       build directory will be used. [EXTPREFIX]
  -external-hostbindir <path> ... Path to Qt tools built for this machine.
                       Use this when -platform does not match the current
                       system, i.e., to make a Canadian Cross Build.

Fine tuning of installation directory layout. Note that all directories
except -sysconfdir should be located under -prefix/-hostprefix:

  -bindir <dir> ......... Executables [PREFIX/bin]
  -headerdir <dir> ...... Header files [PREFIX/include]
  -libdir <dir> ......... Libraries [PREFIX/lib]
  -archdatadir <dir> .... Arch-dependent data [PREFIX]
  -plugindir <dir> ...... Plugins [ARCHDATADIR/plugins]
  -libexecdir <dir> ..... Helper programs [ARCHDATADIR/bin on Windows,
                          ARCHDATADIR/libexec otherwise]
  -importdir <dir> ...... QML1 imports [ARCHDATADIR/imports]
  -qmldir <dir> ......... QML2 imports [ARCHDATADIR/qml]
  -datadir <dir> ........ Arch-independent data [PREFIX]
  -docdir <dir> ......... Documentation [DATADIR/doc]
  -translationdir <dir> . Translations [DATADIR/translations]
  -sysconfdir <dir> ..... Settings used by Qt programs [PREFIX/etc/xdg]
  -examplesdir <dir> .... Examples [PREFIX/examples]
  -testsdir <dir> ....... Tests [PREFIX/tests]

  -hostbindir <dir> ..... Host executables [HOSTPREFIX/bin]
  -hostlibdir <dir> ..... Host libraries [HOSTPREFIX/lib]
  -hostdatadir <dir> .... Data used by qmake [HOSTPREFIX]

Conventions for the remaining options: When an option's description is
followed by a list of values in brackets, the interpretation is as follows:
'yes' represents the bare option; all other values are possible prefixes to
the option, e.g., -no-gui. Alternatively, the value can be assigned, e.g.,
--gui=yes. Values are listed in the order they are tried if not specified;
'auto' is a shorthand for 'yes/no'. Solitary 'yes' and 'no' represent binary
options without auto-detection.

Configure meta:

  -help, -h ............ Display this help screen
  -verbose, -v ......... Print verbose messages during configuration
  -continue ............ Continue configure despite errors
  -redo ................ Re-configure with previously used options.
                         Additional options may be passed, but will not be
                         saved for later use by -redo.
  -recheck [test,...] .. Discard cached negative configure test results.
                         Use this after installing missing dependencies.
                         Alternatively, if tests are specified, only their
                         results are discarded.
  -recheck-all ......... Discard all cached configure test results.

  -feature-<feature> ... Enable <feature>
  -no-feature-<feature>  Disable <feature> [none]
  -list-features ....... List available features. Note that some features
                         have dedicated command line options as well.

  -list-libraries ...... List possible external dependencies.

Build options:

  -opensource .......... Build the Open-Source Edition of Qt
  -commercial .......... Build the Commercial Edition of Qt
  -confirm-license ..... Automatically acknowledge the license

  -release ............. Build Qt with debugging turned off [yes]
  -debug ............... Build Qt with debugging turned on [no]
  -debug-and-release ... Build two versions of Qt, with and without
                         debugging turned on [yes] (Apple and Windows only)
  -optimize-debug ...... Enable debug-friendly optimizations in debug builds
                         [auto] (Not supported with MSVC or Clang toolchains)
  -optimize-size ....... Optimize release builds for size instead of speed [no]
  -optimized-tools ..... Build optimized host tools even in debug build [no]
  -force-debug-info .... Create symbol files for release builds [no]
  -separate-debug-info . Split off debug information to separate files [no]
  -gdb-index ........... Index the debug info to speed up GDB
                         [no; auto if -developer-build with debug info]
  -strip ............... Strip release binaries of unneeded symbols [yes]
  -gc-binaries ......... Place each function or data item into its own section
                         and enable linker garbage collection of unused
                         sections. [auto for static builds, otherwise no]
  -force-asserts ....... Enable Q_ASSERT even in release builds [no]
  -developer-build ..... Compile and link Qt for developing Qt itself
                         (exports for auto-tests, extra checks, etc.) [no]

  -shared .............. Build shared Qt libraries [yes] (no for UIKit)
  -static .............. Build static Qt libraries [no] (yes for UIKit)
  -framework ........... Build Qt framework bundles [yes] (Apple only)

  -platform <target> ... Select host mkspec [detected]
  -xplatform <target> .. Select target mkspec when cross-compiling [PLATFORM]
  -device <name> ....... Cross-compile for device <name>
  -device-option <key=value> ... Add option for the device mkspec

  -appstore-compliant .. Disable code that is not allowed in platform app stores.
                         This is on by default for platforms which require distribution
                         through an app store by default, in particular Android,
                         iOS, tvOS, watchOS, and Universal Windows Platform. [auto]

  -qtnamespace <name> .. Wrap all Qt library code in 'namespace <name> {...}'.
  -qtlibinfix <infix> .. Rename all libQt5*.so to libQt5*<infix>.so.
  -qtlibinfix-plugins .. Rename Qt plugins according to -qtlibinfix [no]

  -testcocoon .......... Instrument with the TestCocoon code coverage tool [no]
  -gcov ................ Instrument with the GCov code coverage tool [no]

  -trace [backend] ..... Enable instrumentation with tracepoints.
                         Currently supported backends are 'etw' (Windows) and
                         'lttng' (Linux), or 'yes' for auto-detection. [no]

  -sanitize {address|thread|memory|fuzzer-no-link|undefined}
                         Instrument with the specified compiler sanitizer.
                         Note that some sanitizers cannot be combined;
                         for example, -sanitize address cannot be combined with
                         -sanitize thread.

  -coverage {trace-pc-guard|source-based}
                         Specify the 'trace-pc-guard' coverage instrumentation for
                         sanitizers or generate instrumented code to collect execution
                         counts and enable code coverage analysis, respectively. (Clang only)

  -c++std <edition> .... Select C++ standard <edition> [c++2a/c++17/c++14/c++11]
                         (Not supported with MSVC 2015)

  -sse2 ................ Use SSE2 instructions [auto]
  -sse3/-ssse3/-sse4.1/-sse4.2/-avx/-avx2/-avx512
                         Enable use of particular x86 instructions [auto]
                         Enabled ones are still subject to runtime detection.
  -mips_dsp/-mips_dspr2  Use MIPS DSP/rev2 instructions [auto]

  -qreal <type> ........ typedef qreal to the specified type. [double]
                         Note: this affects binary compatibility.

  -R <string> .......... Add an explicit runtime library path to the Qt
                         libraries. Supports paths relative to LIBDIR.
  -rpath ............... Link Qt libraries and executables using the library
                         install path as a runtime library path. Similar to
                         -R LIBDIR. On Apple platforms, disabling this implies
                         using absolute install names (based in LIBDIR) for
                         dynamic libraries and frameworks. [auto]

  -reduce-exports ...... Reduce amount of exported symbols [auto]
  -reduce-relocations .. Reduce amount of relocations [auto] (Unix only)

  -plugin-manifests .... Embed manifests into plugins [no] (Windows only)
  -static-runtime ...... With -static, use static runtime [no] (Windows only)

  -pch ................. Use precompiled headers [auto]
  -ltcg ................ Use Link Time Code Generation [no]
  -linker [bfd,gold,lld] Force use of the GNU ld, GNU gold or LLVM/LLD linker
                         instead of default one (GCC only)
  -incredibuild-xge .... Use the IncrediBuild XGE [no] (Windows only)
  -ccache .............. Use the ccache compiler cache [no] (Unix only)
  -make-tool <tool> .... Use <tool> to build qmake [nmake] (Windows only)
  -mp .................. Use multiple processors for compilation (MSVC only)

  -warnings-are-errors . Treat warnings as errors [no; yes if -developer-build]
  -silent .............. Reduce the build output so that warnings and errors
                         can be seen more easily

Build environment:

  -sysroot <dir> ....... Set <dir> as the target sysroot
  -gcc-sysroot ......... With -sysroot, pass --sysroot to the compiler [yes]

  -pkg-config .......... Use pkg-config [auto] (Unix only)

  -D <string> .......... Pass additional preprocessor define
  -I <string> .......... Pass additional include path
  -L <string> .......... Pass additional library path
  -F <string> .......... Pass additional framework path (Apple only)

  -sdk <sdk> ........... Build Qt using Apple provided SDK <sdk>. The argument
                         should be one of the available SDKs as listed by
                         'xcodebuild -showsdks'.
                         Note that the argument applies only to Qt libraries
                         and applications built using the target mkspec - not
                         host tools such as qmake, moc, rcc, etc.

  -android-sdk path .... Set Android SDK root path [$ANDROID_SDK_ROOT]
  -android-ndk path .... Set Android NDK root path [$ANDROID_NDK_ROOT]
  -android-ndk-platform  Set Android platform
  -android-ndk-host .... Set Android NDK host (linux-x86, linux-x86_64, etc.)
                         [$ANDROID_NDK_HOST]
  -android-abis .......  Comma separated Android abis, default is:
                         armeabi-v7a,arm64-v8a,x86,x86_64
  -android-javac-target  Set the javac build target version [7]
  -android-javac-source  Set the javac build source version [7]
  -android-style-assets  Automatically extract style assets from the device at
                         run time. This option makes the Android style behave
                         correctly, but also makes the Android platform plugin
                         incompatible with the LGPL2.1. [yes]

Component selection:

  -skip <repo> ......... Exclude an entire repository from the build.
  -make <part> ......... Add <part> to the list of parts to be built.
                         Specifying this option clears the default list first.
                         [libs and examples, also tools if not cross-building,
                         also tests if -developer-build]
  -nomake <part> ....... Exclude <part> from the list of parts to be built.
  -compile-examples .... When unset, install only the sources of examples
                         [no on WebAssembly, otherwise yes]
  -gui ................. Build the Qt GUI module and dependencies [yes]
  -widgets ............. Build the Qt Widgets module and dependencies [yes]
  -no-dbus ............. Do not build the Qt D-Bus module
                         [default on Android and Windows]
  -dbus-linked ......... Build Qt D-Bus and link to libdbus-1 [auto]
  -dbus-runtime ........ Build Qt D-Bus and dynamically load libdbus-1 [no]
  -accessibility ....... Enable accessibility support [yes]
                         Note: Disabling accessibility is not recommended.

Qt comes with bundled copies of some 3rd party libraries. These are used
by default if auto-detection of the respective system library fails.

Core options:

  -doubleconversion .... Select used double conversion library [system/qt/no]
                         No implies use of sscanf_l and snprintf_l (imprecise).
  -glib ................ Enable Glib support [no; auto on Unix]
  -eventfd ............. Enable eventfd support
  -inotify ............. Enable inotify support
  -iconv ............... Enable iconv(3) support [posix/sun/gnu/no] (Unix only)
  -icu ................. Enable ICU support [auto]
  -pcre ................ Select used libpcre2 [system/qt/no]
  -pps ................. Enable PPS support [auto] (QNX only)
  -zlib ................ Select used zlib [system/qt]

  Logging backends:
    -journald .......... Enable journald support [no] (Unix only)
    -syslog ............ Enable syslog support [no] (Unix only)
    -slog2 ............. Enable slog2 support [auto] (QNX only)

Network options:

  -ssl ................. Enable either SSL support method [auto]
  -no-openssl .......... Do not use OpenSSL [default on Apple and WinRT]
  -openssl-linked ...... Use OpenSSL and link to libssl [no]
  -openssl-runtime ..... Use OpenSSL and dynamically load libssl [auto]
  -schannel ............ Use Secure Channel [no] (Windows only)
  -securetransport ..... Use SecureTransport [auto] (Apple only)

  -sctp ................ Enable SCTP support [no]

  -libproxy ............ Enable use of libproxy [no]
  -system-proxies ...... Use system network proxies by default [yes]

Gui, printing, widget options:

  -cups ................ Enable CUPS support [auto] (Unix only)

  -fontconfig .......... Enable Fontconfig support [auto] (Unix only)
  -freetype ............ Select used FreeType [system/qt/no]
  -harfbuzz ............ Select used HarfBuzz-NG [system/qt/no]
                         (Not auto-detected on Apple and Windows)

  -gtk ................. Enable GTK platform theme support [auto]

  -lgmon ............... Enable lgmon support [auto] (QNX only)

  -no-opengl ........... Disable OpenGL support
  -opengl <api> ........ Enable OpenGL support. Supported APIs:
                         es2 (default on Windows), desktop (default on Unix),
                         dynamic (Windows only)
  -opengles3 ........... Enable OpenGL ES 3.x support instead of ES 2.x [auto]
  -egl ................. Enable EGL support [auto]
  -angle ............... Use bundled ANGLE to support OpenGL ES 2.0 [auto]
                         (Windows only)
  -combined-angle-lib .. Merge LibEGL and LibGLESv2 into LibANGLE (Windows only)

  -qpa <name> .......... Select default QPA backend(s) (e.g., xcb, cocoa, windows)
                         A prioritized list separated by semi-colons.
  -xcb-xlib............. Enable Xcb-Xlib support [auto]

  Platform backends:
    -direct2d .......... Enable Direct2D support [auto] (Windows only)
    -directfb .......... Enable DirectFB support [no] (Unix only)
    -eglfs ............. Enable EGLFS support [auto; no on Android and Windows]
    -gbm ............... Enable backends for GBM [auto] (Linux only)
    -kms ............... Enable backends for KMS [auto] (Linux only)
    -linuxfb ........... Enable Linux Framebuffer support [auto] (Linux only)
    -xcb ............... Enable X11 support [auto] (Linux only)

  Input backends:
    -libudev............ Enable udev support [auto]
    -evdev ............. Enable evdev support [auto]
    -imf ............... Enable IMF support [auto] (QNX only)
    -libinput .......... Enable libinput support [auto]
    -mtdev ............. Enable mtdev support [auto]
    -tslib ............. Enable tslib support [auto]
    -bundled-xcb-xinput  Use bundled XInput2 support [auto]
    -xkbcommon ......... Enable key mapping support [auto]

  Image formats:
    -gif ............... Enable reading support for GIF [auto]
    -ico ............... Enable support for ICO [yes]
    -libpng ............ Select used libpng [system/qt/no]
    -libjpeg ........... Select used libjpeg [system/qt/no]

Database options:

  -sql-<driver> ........ Enable SQL <driver> plugin. Supported drivers:
                         db2 ibase mysql oci odbc psql sqlite2 sqlite tds
                         [all auto]
  -sqlite .............. Select used sqlite3 [system/qt]

Qt3D options:

  -assimp .............. Select used assimp library [system/qt/no]
  -qt3d-profile-jobs ... Enable jobs profiling [no]
  -qt3d-profile-gl ..... Enable OpenGL profiling [no]
  -qt3d-simd ........... Select level of SIMD support [no/sse2/avx2]
  -qt3d-render ......... Enable the Qt3D Render aspect [yes]
  -qt3d-input .......... Enable the Qt3D Input aspect [yes]
  -qt3d-logic .......... Enable the Qt3D Logic aspect [yes]
  -qt3d-extras ......... Enable the Qt3D Extras aspect [yes]
  -qt3d-animation....... Enable the Qt3D Animation aspect [yes]

Further image format options:

  -jasper .............. Enable JPEG-2000 support using the JasPer library [no]
  -mng ................. Enable MNG support [no]
  -tiff ................ Enable TIFF support [system/qt/no]
  -webp ................ Enable WEBP support [system/qt/no]

Multimedia options:

  -pulseaudio .......... Enable PulseAudio support [auto] (Unix only)
  -alsa ................ Enable ALSA support [auto] (Unix only)
  -no-gstreamer ........ Disable support for GStreamer
  -gstreamer [version] . Enable GStreamer support [auto]
                         With no parameter, 1.0 is tried first, then 0.10.
  -evr ................. Enables EVR in DirectShow and WMF [auto]

QtQuick3D options:

  -assimp .............. Select used assimp library [system/qt/no]

TextToSpeech options:

  -flite ............... Enable Flite support [auto] (Unix only)
  -flite-alsa .......... Enable Flite with ALSA support [auto] (Unix only)
  -speechd ............. Enable speech dispatcher support [auto] (Unix only)

WebEngine options:

  -webengine-alsa ................ Enable ALSA support [auto] (Linux only)
  -webengine-pulseaudio .......... Enable PulseAudio support [auto]
                                   (Linux only)
  -webengine-embedded-build ...... Enable Linux embedded build [auto]
                                   (Linux only)
  -webengine-icu ................. Use system ICU libraries [system/qt]
                                   (Linux only)
  -webengine-ffmpeg .............. Use system FFmpeg libraries [system/qt]
                                   (Linux only)
  -webengine-opus ................ Use system Opus libraries [system/qt]
                                   (Linux only)
  -webengine-webp ................ Use system WebP libraries [system/qt]
                                   (Linux only)
  -webengine-pepper-plugins ...... Enable use of Pepper Flash and Widevine
                                   plugins [auto]
  -webengine-printing-and-pdf .... Enable use of printing and output to PDF
                                   [auto]
  -webengine-proprietary-codecs .. Enable support for proprietary codecs [no]
  -webengine-spellchecker ........ Enable support for spellchecker [yes]
  -webengine-native-spellchecker . Enable support for native spellchecker [no]
                                   (macOS only)
  -webengine-webrtc .............. Enable support for WebRTC [auto]

具体需要那些东西,大家根据文档自行修改autoconfig.sh文件,注意配置项的顺序,如果按照文档来最后却报配置项不对,那多半是顺序有问题,往前移一点应该就好了

cd build
sudo ./autoconfig.sh

不出意外应该就没问题
在这里插入图片描述
如果需要加入比如tslib freetype之类的支持,那就要现在树莓派上安装对应的库,然后同步到X86电脑上的根文件目录,再运行autoconfig.sh

sudo make -j24 #编译,j后面的数字是线程数,根据自己的电脑来
sudo make install # 安装,安装目录在autoconfig.sh中的extprefix中指定了

未完待续

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

树莓派安装Ubuntu22.04后使用X86_Linux交叉编译Qt5+opencv4 的相关文章

  • Python将文件从Linux复制到WIndows

    我正在构建一个网站 该网站有一个表单 可以捕获用户数据并在用户数据上运行一些cgi cgi 的第一步是需要将文件从 Linux Web 服务器复制到 Windows 计算机 服务器将使用 Active Directory 角色帐户作为复制凭
  • 针对不同处理器架构的 Gradle android 构建

    我想使用 Gradle 为 4 个不同的 Android CPU 处理器架构 armeabi armeabi v7a x86 mips 构建 4 个单独的 apk 我有为 4 个 CPU 架构构建的本机 OpenCV 库libs folde
  • 在信号/槽处理期间删除 QObject

    我知道从槽处理中删除 QObject 可能会使应用程序崩溃 因为它可能有其他排队的事件 因此 我将使用 obj gt deleteLater 而不是使用 delete obj 据我所知 obj 等待处理所有排队的事件 然后 删除 obj Q
  • 用于时间线数据的类似 gnuplot 的程序

    我正在寻找一个类似 gnuplot用于在时间轴中绘制数据图表的程序 类似 gnuplot 在 Linux 上运行 命令行功能 GUI 对我帮助不大 可编写脚本的语法 输出为 jpg png svg 或 gif 输出应该是这样的 set5 s
  • pthread_self() 返回的线程 ID 与调用 gettid(2) 返回的内核线程 ID 不同

    这句话来自于pthread self 的手册页 http linux die net man 3 pthread self 那么 我应该根据什么来决定是否应该使用pthread self or gettid确定哪个线程正在运行该函数 两者都
  • Docker Desktop 未安装,提示 docker-ce-cli 无法安装

    在一次在线培训课程中 讲师提到他有 安装了 Docker Desktop 的 Ubuntu 虚拟机 因此 我尝试在 Windows 10 物理主机上安装相同的程序指示 https docs docker com desktop linux
  • 套接字发送调用被阻塞很长时间

    我每 10 秒在套接字上发送 2 个字节的应用程序数据 阻塞 但发送调用在下面的最后一个实例中被阻塞超过 40 秒 2012 06 13 12 02 46 653417 信息 发送前 2012 06 13 12 02 46 653457 信
  • Ubuntu 16.04/Django - Gunicorn - Worker 无法启动

    我正在 Digital Ocean Ubuntu 16 04 VPS 上部署 Django 项目 我使用的是Django的一键安装 然后替换为我的项目 问题是服务器返回502 Error EDIT 没有realestate scanner
  • Ctrl-p 和 Ctrl-n 在 Docker 下表现异常

    For the life of me I can t seem to figure out why ctrl p and ctrl n don t work like they re supposed to under the Docker
  • 在 opencv 中一次性将旋转和平移结合起来

    我有一段用于旋转和平移图像的代码 Point2f pt 0 in rows double angle atan trans c trans b 180 M PI Mat r getRotationMatrix2D pt angle 1 0
  • 为什么 call_usermodehelper 大多数时候都会失败?

    从内核模块中 我尝试使用 call usermodehelper 函数来执行可执行文件 sha1 该可执行文件将文件作为参数并将文件的 SHA1 哈希和写入另一个文件 名为输出 可执行文件完美运行 int result 1 name hom
  • BASH 中的空函数

    我正在使用 FPM 工具创建 deb 包 此工具在从支持的文件中删除包之前 之后创建 不幸的是FPM生成的bash脚本包含这样的函数 dummy 该脚本退出时出现错误 语法错误 意外 BASH 不允许空函数吗 哪个版本的 bash linu
  • 亚马逊 Linux - 安装 openjdk-debuginfo?

    我试图使用jstack在 ec2 实例上amazon linux 所以我安装了openjdk devel包裹 sudo yum install java 1 7 0 openjdk devel x86 64 但是 jstack 引发了异常j
  • 使用 --prof 选项创建多个日志文件而不是一个 v8.log 的节点

    我正在尝试使用 prof 选项来分析我的 Node 应用程序 但我发现不是一个单一的 v8 log 文件 而是使用诸如isolate 0x9582b40 v8 log isolate 0xa1cab78 v8 6049 等前缀创建的多个文件
  • 由于 abi::cxx11 符号导致的链接问题?

    我们最近收到一份报告 因为GCC 5 1 libstdc 和双 ABI http gcc gnu org onlinedocs libstdc manual using dual abi html 它似乎Clang 不知道 GCC 内联名称
  • 尝试使使用 OpenCV 的 java 应用程序(可执行 Jar)可移植。出现不满意的链接错误

    我制作了一个应用程序 用于从网络摄像头抓取视频并使用 OpenCV 和 JavaCV 检测运动 我正在尝试使用 eclipse 导出为可执行 jar 该程序在 eclipse 中运行良好 就像我编写该程序的计算机上的 exe jar 一样
  • 隐式声明“gets”

    据我所知 隐式声明 通常意味着该函数必须在调用之前放置在程序的顶部 或者我需要声明原型 然而 gets应该在stdio h文件 我已包含 有没有什么办法解决这一问题 include
  • 在 ubuntu 中找不到 .android 文件夹 [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 我在哪里可以找到 android在 Ubuntu 中 我想使用debug keystore 转到您的主文件夹并按 ctrl h 瞧
  • 如何使用 VSCode 调试 Linux 核心转储?

    我故意从我使用 VSCode 编写的 C 应用程序生成核心转储 我不知道如何调试核心转储 有没有人愿意分享这方面的经验 更新 我相信我现在已经可以使用了 我为核心文件创建了第二个调试配置 我需要添加指向生成的转储文件的 coreDumpPa
  • Unix 中的访问时间是多少

    我想知道访问时间是多少 我在网上搜索但得到了相同的定义 读 被改变 我知道与touch我们可以改变它 谁能用一个例子来解释一下它是如何改变的 有没有办法在unix中获取创建日期 时间 stat结构 The stat 2 结构跟踪所有文件日期

随机推荐

  • GitHub上整理的一些实用工具

    2019独角兽企业重金招聘Python工程师标准 gt gt gt 技术站点 Hacker News 非常棒的针对编程的链接聚合网站 Programming reddit 同上 MSDN 微软相关的官方技术集中地 主要是文档类 infoq
  • Bootstrap日期控件,实现日期控件只选择不准输入效果

    一 引入日期控件CSS JS 二 input就用控件 td 发行时间 td td div class input group date style width 14em div td
  • CDN,P2P,PCDN的区别?

    如何来有效解决网络卡顿的问题 这就是我们SwarmCloud要解决的问题啦 那么为了大家能更好地了解SwarmCloud的网络加速技术 本篇文章为大家介绍一下与网络加速有关的几个重要概念 一起了解一下CDN P2P和PCDN究竟是什么吧 1
  • 黄色叹号_资深从业者教你如何关闭SolidWorks任务栏的感叹号图标提示

    很多小伙伴在安装启动SolidWorks的时候 是不是会弹出内存不足的提示 或者在SolidWorks任务栏显示黄色感叹号图标 看着很不顺眼 我们回头一看自己的电脑内存 显存 发现又很充足 这种情况一般是新安装SolidWorks才会出现
  • QT day2

    1 完成登录框的按钮操作 并在登录成功后进行界面跳转 跳转界面代码 include form h include ui form h Form Form QWidget parent QWidget parent ui new Ui For
  • 银河麒麟安装mysql

    1 在线安装和卸载 安装arm版 先看下本地源 sudo gedit etc apt sources list 或者 sudo pluma etc apt sources list 查询mysql源 sudo apt search mysq
  • 实用小软件实现Mac读写ntfs U盘 移动硬盘

    对于Mac默认情况下 不支持NTFS U盘移动硬盘的读写问题 一直困扰着Mac用户 其实解决的方法还不少 方案一 有人建议敲代码解决 可是 对于小白用户来说 sudo nano blah blah 这是个什么鬼 完全不懂啊 方案二 搞个Wi
  • 天梯题集——冰岛人(隐藏条件:考虑嫡系)

    前文 愿天下有情人都是失散多年的兄妹 与 冰岛人 解题思路几乎是同理的 不过这里需要考虑多一个是否嫡系的关系 卡了我好久 又来一个隐藏条件 长知识 长知识 用递归实现很容易出现超时 循环果然比递归效率高 循环与递归效率的比较 冰岛人 解题难
  • 配置apache允许所有ip访问

    1 打开 apache安装目录 conf httpd conf 配置文件 a 搜索Listen监听端口 修改如下 Listen Allows you to bind Apache to specific IP addresses and o
  • 交换律和结合律

    交换律和结合律 加法交换律 A B B A 交换两个加数的位置 结果不变 乘法交换律 AB BA 交换两个因数的位置 结果不变 加法结合律 A B C A B C 三个数相加 先计算前两个数再计算第三个数的结果与先计算后两个数再计算第一个数
  • linux文件操作常见考题_linux试题

    1 当登录Linux时 一个具有唯一进程ID号的shell将被调用 这个ID是什么 B A NID B PID C UID D CID 2 用vi打开一个文件 如何用字母 new 来代替字母 old A A s old new g B s
  • js中null、NaN和undefined的区别

    1 js中null NaN和undefined的区别 在js 中未定义的值 是null 定义未赋值为undefined null 为特殊的一种object NAN 为特使一种number 数据类型
  • 【python】基础课程 在这里哦

    推荐一些Python学习资料 如果你是准备学习Python或者正在学习 下面这些你应该能用得上 Python所有方向的学习路线图 清楚各个方向要学什么东西 100多节Python课程视频 涵盖必备基础 爬虫和数据分析 100多个Python
  • pysot训练自己数据集

    pysot如何训练网络呢 有没有人知道呢 咱们可以互相交流
  • 【通信基础】通信基础、编码&&调制

    https www jianshu com p 128c1157eb97 原文地址 1 通信基础 编码 调制 1 物理层的基本概念 物理层解决如何在连接各种计算机的传输媒体上传输数据比特流 而不是指具体的传输媒体 物理层的主要任务 确定与传
  • python水印倾斜_python中图像特定位置的水印算法

    目前我正在处理一个图像处理项目 在这个项目中 我需要将图像分割成几个片段 然后在每个片段上应用水印 在 我写了一个代码 通过掩蔽将图像分成几段 您可以找到代码here 现在我想在每个片段上实现水印 水印教程可以在here找到 在 我该怎么做
  • LeetCode--初级算法--数组篇--第二题--买卖股票的最佳时机 II

    GitHub地址 题目 给定一个数组 它的第 i 个元素是一支给定股票第 i 天的价格 设计一个算法来计算你所能获取的最大利润 你可以尽可能地完成更多的交易 多次买卖一支股票 注意 你不能同时参与多笔交易 你必须在再次购买前出售掉之前的股票
  • 淘宝SEO珍贵笔记

    2019独角兽企业重金招聘Python工程师标准 gt gt gt 分享淘宝SEO技术 讲诉如何使用 关键词 带来百万IP流量 大家都有目共睹淘宝七月八号改变规则后引发了不少争议 后面所引起的众多卖家 围攻 淘宝之事也不仅发生过一次了 还有
  • 如何解决vcruntime140.dll找不到的问题?两种方法教你解决

    当你在运行某些应用程序或游戏时 可能会遇到一个错误提示 即 找不到vcruntime140 dll 文件 这是因为你的电脑中缺少了这个动态链接库文件 这个问题可能会导致你无法正常使用某些应用程序 在本文中 我们将介绍两种方法来解决 目录 一
  • 树莓派安装Ubuntu22.04后使用X86_Linux交叉编译Qt5+opencv4

    文章目录 准备工作 环境搭建 准备编译 未完待续 准备工作 树莓派安装Ubuntu 直接从官网下载对应的镜像烧写工具下载地址 工具里面准备好了对应的镜像地址 直接烧写入SD卡就行了 进入系统 ubuntu server22 04默认密码应该