如何为Raspberry Pi交叉编译Qt Quick应用程序?

vsz

我已经成功QT += core gui为Raspberry Pi交叉编译了“标准” Qt应用程序(),但是我很难用Qt Quick(QT += quick来完成同样的工作

我安装了交叉编译工具链,使用它成功编译了Qt,并且我的Qt GUI应用程序现在可以在Raspberry Pi上运行。

现在,我尝试在Raspberry Pi上运行Qt Quick示例之一,但没有成功。我从“欢迎使用/示例”中打开了示例,我可以使用Debian在PC上成功构建并运行它们,但是如果我尝试为Raspberry Pi构建它(通过添加与常规Qt应用程序相同的工具包),则不会甚至没有编译。它给出以下错误:

:-1: error: Unknown module(s) in QT: quick

这似乎表明Qt Quick不是我的Qt构建的一部分。

我再次检查了交叉编译器的配置方式:

Building on:   linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for:  devices/linux-rasp-pi-g++ (arm, CPU features: none detected)
Platform notes:

            - Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx

Build options:
  Configuration .......... accessibility audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile dbus egl eglfs eglfs_brcm enable_new_dtags evdev eventfd freetype full-config getaddrinfo getifaddrs harfbuzz iconv inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap nis no-pkg-config opengl opengles2 pcre png posix_fallocate precompile_header qpa qpa reduce_exports release rpath shared small-config system-zlib threadsafe-cloexec 
  Build parts ............  libs
  Mode ................... release
  Using sanitizer(s)...... none
  Using C++ standard ..... c++11
  Using gold linker....... no
  Using new DTAGS ........ yes
  Using PCH .............. yes
  Target compiler supports:
    Neon ................. no

Qt modules and options:
  Qt D-Bus ............... yes (loading dbus-1 at runtime)
  Qt Concurrent .......... yes
  Qt GUI ................. yes
  Qt Widgets ............. yes
  Large File ............. yes
  QML debugging .......... yes
  Use system proxies ..... no

Support enabled for:
  Accessibility .......... yes
  ALSA ................... no
  CUPS ................... no
  Evdev .................. yes
  FontConfig ............. no
  FreeType ............... yes (bundled copy)
  Glib ................... no
  GStreamer .............. no
  GTK theme .............. no
  HarfBuzz ............... yes (bundled copy)
  Iconv .................. yes
  ICU .................... no
  Image formats: 
    GIF .................. yes (plugin, using bundled copy)
    JPEG ................. yes (plugin, using bundled copy)
    PNG .................. yes (in QtGui, using bundled copy)
  libinput................ no
  Logging backends: 
    journald ............... no
    syslog   ............... no
  mtdev .................. no
  Networking: 
    getaddrinfo .......... yes
    getifaddrs ........... yes
    IPv6 ifname .......... yes
    libproxy.............. no
    OpenSSL .............. no
  NIS .................... yes
  OpenGL / OpenVG: 
    EGL .................. yes
    OpenGL ............... yes (OpenGL ES 2.0+)
    OpenVG ............... no
  PCRE ................... yes (bundled copy)
  pkg-config ............. no 
  PulseAudio ............. no
  QPA backends: 
    DirectFB ............. no
    EGLFS ................ yes
      EGLFS i.MX6....... . no
      EGLFS KMS .......... no
      EGLFS Mali ......... no
      EGLFS Raspberry Pi . yes
      EGLFS X11 .......... no
    LinuxFB .............. yes
    Mir client............ no
    XCB .................. no
  Session management ..... yes
  SQL drivers: 
    DB2 .................. no
    InterBase ............ no
    MySQL ................ no
    OCI .................. no
    ODBC ................. no
    PostgreSQL ........... no
    SQLite 2 ............. no
    SQLite ............... yes (plugin, using bundled copy)
    TDS .................. no
  tslib .................. no
  udev ................... no
  xkbcommon-x11........... no
  xkbcommon-evdev......... no
  zlib ................... yes (system library)

Qt Quick甚至没有出现在选项列表中。这是否意味着交叉编译器不支持它?我认为应该使用“ QML调试”选项,因为如果没有Qt Quick,还应该使用QML。

OpenGL 2.0处于活动状态,所以这不应该成为问题。

vsz

由于我的PC上确实有一个Qt5Quick库,而Raspberry Pi上没有使用该名称的库,因此看来它根本不是内置的。

该指南按依赖性顺序列出了可选模块,但还不够。

构建qtquickcontrols和之后qtquick2,问题得以解决。

安装了SD卡的映像后,

cd ~/opt/qt5/qtquickcontrols
/usr/local/qt5pi/bin/qmake .
make -j4
sudo make install

以此类推。然后将图像写回到SD卡,Qt Quick可以在Raspberry Pi上运行(即使仅全屏显示)。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在Raspberry pi 1模型B中交叉编译FreeBSD的go应用程序

如何使用 CMake 交叉编译 qt 应用程序

Raspberry PI 3的C ++ Qt 5.10交叉编译此应用程序无法启动,因为它无法在“”中找到或加载Qt平台插件“ xcb”。

如何准备带有Raspbian的Raspberry Pi,以便可以从Linux主机交叉编译Qt5程序?

如何使用gcc交叉编译Raspberry Pi的程序?

如何为Raspberry Pi Zero W交叉编译Rust代码

如何交叉编译A13 Olinuxino(armv5)板的Qt应用程序?

为 raspberry pi 设置 Qt 以进行交叉编译

使用Qt和opencv交叉编译到Raspberry Pi

如何为 Yocto Linux 交叉编译具有库依赖项的应用程序?

Raspberry Pi的交叉编译rethinkdb

将Raspberry Pi Camera与Qt应用程序集成

Raspberry Pi 2 Qt应用程序崩溃

如何为 Swing 应用程序编译 orson 图表库

在Raspberry Pi上执行交叉编译的程序时,“没有这样的文件或目录”

如何为Qt应用程序提供脚本支持?

如何为Qt独立应用程序创建清单文件

如何为Qt应用程序构建崩溃垫

交叉编译Qt5.10.1 Raspberry pi3 B +拉伸

尝试在Raspberry Pi(Windows)上运行交叉编译的Qt时出现“非法指令”

为 Raspberry Pi 4 交叉编译 QtWebEngine

交叉编译Raspberry Pi 2错误

交叉编译Raspberry Pi的Nginx时出错

如何使用Qt Creator编译简单的OpenCL应用程序?

无法为Raspberry PI 0交叉编译Qt 5.14.2,因为它“需要C ++ 11编译器”

如何为 Raspberry pi 3 编译 ARMv8 代码

如何为Raspberry Pi编写简单的UART Linux设备驱动程序?

如何为ARM交叉编译Hello World C程序

Qt Creator正确设置了Raspberry Pi 2的交叉编译和远程部署-生成错误架构的二进制文件