简体   繁体   English

在Linux ARM上编译没有GUI支持的Qt5

[英]Compile Qt5 without GUI support on Linux ARM

I'm having troubles getting Qt5 working without GUI elements on my Cortex-A9 board due the OpenGL dependencies (ie OpenGL ES2). 由于OpenGL依赖性(即OpenGL ES2),我无法在Cortex-A9板上没有GUI元素的情况下使Qt5正常工作。 I am running a Ubuntu 14.04 rootfs. 我正在运行Ubuntu 14.04 rootfs。

Is there any way to disable the generation of GUI classes, starting from git repository? 从git仓库开始,有什么方法可以禁用GUI类的生成吗? (Target version 5.3). (目标版本5.3)。 The only modules I need are QtCore, QtXML and QtWebSockets/QtNetwork 我唯一需要的模块是QtCore,QtXML和QtWebSockets / QtNetwork

The following seems to get Qt5 to compile with a LinuxFB driver and no OpenGL. 以下内容似乎使Qt5可以使用LinuxFB驱动程序而不使用OpenGL进行编译。

./configure -qpa linuxfb -no-largefile -opensource -verbose -release \
 -no-accessibility  -confirm-license -no-sse -no-sse2 \
 -qt-zlib -qt-libpng -nomake examples -nomake demos -nomake docs -nomake tests \
 -make libs --prefix=/usr -no-pch -no-iconv -no-nis -no-xkb -no-xshape \
 -no-xvideo -no-xsync -no-xinerama -no-xcursor -no-xfixes -no-xrandr -no-kms \
 -no-directfb -no-eglfs -no-xcb -no-dbus -no-icu -no-cups -no-gif \
 -no-accessibility -no-opengl -nomake quick -make quick1  \
 -skip multimedia -skip webkit -nomake webkit -no-pkg-config \
 -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci \
 -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 \
 -no-sql-sqlite_symbian -no-sql-tds -nomake tools \
 -device linux-custom-g++ -device-option CROSS_COMPILE=$TGT_TOOL_NAME-

The keys are, -no-opengl and -nomake quick . 关键是-no-opengl-nomake quick QtQuick2 will pull in OpenGL. QtQuick2将拉入OpenGL。

Also it seems I must do the following, 而且看来我必须做以下事情,

touch module_qtwebkit-make_first

This stops the build system from trying to make QtWebKit ; 这将阻止构建系统尝试制作QtWebKit it seems buggy. 似乎越野车。 This still has the GUI classes, but don't link to them. 它仍然具有GUI类,但不要链接到它们。 That is before the plain make . 这是明摆着的前make For the install target, 对于安装目标,

touch module_qtwebkit-install_subtargets

was required. 是必需的。 Later Qt5 releases may have fixed the QtWebkit build issues. 更高版本的Qt5可能已解决了QtWebkit构建问题。

似乎至少Qt 5.6.2支持-no-gui-no-widgets配置选项。

Ubuntu team itself declared that Qt5.3. Ubuntu团队本身宣布使用Qt5.3。 is still under investigation for armhf platforms and that probably it will be available from 14.10 release. 目前仍在对armhf平台进行调查,并且可能将从14.10版本开始提供。 Somehow, crawling on Qt forums, there are missing dependencies and compiling errors when there's no OpenGL/GUI module. 在没有OpenGL / GUI模块的情况下,以某种方式在Qt论坛上爬网时,缺少依赖项和编译错误。

I resolved it installing 1t 5.2.1 from repositories and then the missing QWebSocket module from git repository. 我解决了从存储库安装1t 5.2.1的问题,然后从git存储库安装了丢失的QWebSocket模块。

In order to make this module compatible with older Qt version, the file .qmake.conf: 为了使该模块与较旧的Qt版本兼容,请使用文件.qmake.conf:

MODULE_VERSION = 5.3.2 --> to desired one (i.e. 5.2.1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM