我已经成功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处于活动状态,所以这不应该成为问题。
由于我的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] 删除。
我来说两句