简体   繁体   中英

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). I am running a Ubuntu 14.04 rootfs.

Is there any way to disable the generation of GUI classes, starting from git repository? (Target version 5.3). The only modules I need are QtCore, QtXML and QtWebSockets/QtNetwork

The following seems to get Qt5 to compile with a LinuxFB driver and no 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 . QtQuick2 will pull in OpenGL.

Also it seems I must do the following,

touch module_qtwebkit-make_first

This stops the build system from trying to make QtWebKit ; it seems buggy. This still has the GUI classes, but don't link to them. That is before the plain make . For the install target,

touch module_qtwebkit-install_subtargets

was required. Later Qt5 releases may have fixed the QtWebkit build issues.

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

Ubuntu team itself declared that Qt5.3. is still under investigation for armhf platforms and that probably it will be available from 14.10 release. Somehow, crawling on Qt forums, there are missing dependencies and compiling errors when there's no OpenGL/GUI module.

I resolved it installing 1t 5.2.1 from repositories and then the missing QWebSocket module from git repository.

In order to make this module compatible with older Qt version, the file .qmake.conf:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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