Only eglfs when cross-compiling QT static for Raspberry PI - c++

I have cross-compiled QT static for Raspberry PI using
./configure -opengl es2 -opensource -confirm-license -release -static \
-prefix /usr/local/qt5static -hostprefix ~/raspi/qt5 -extprefix ~/raspi/qt5static \
-device linux-rasp-pi-novc-g++ \
-device-option CROSS_COMPILE=arm-raspbian-linux-gnueabihf- \
-optimized-qmake -reduce-exports \
-sysroot ~/raspi/sysroot \
-make libs -make tools -no-use-gold-linker -v
where the 'novc' device is essentially the same as linux-rasp-pi-g++ but with no includes or libs from /opt/vc. When I run the program, it starts in full screen (because of eglfs), and when probed with export QT_DEBUG_PLUGINS=1 yields*
QFactoryLoader::QFactoryLoader() ignoring
"org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3" since
plugins are disabled in static builds qt.qpa.plugin: Could not find
the Qt platform plugin "android" in "" This application failed to
start because no Qt platform plugin could be initialized. Reinstalling
the application may fix this problem.
Available platform plugins are: eglfs, eglfs.
It is fine that the factory loader fails, but why is there only eglfs, and where are there two of them? How can I make sure xcb is an option and that it is the default option?
*I use myapp -platform android since I know that Android is not in there. The dynamically linked QT from sudo apt install qt shows
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl,
offscreen, xcb.
I would like that from my static compile. Here are my QPA backends (I do see eglfs for X11, and maybe that is what I have to trigger...)
QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ no
EGLFS VSP2 ........................... no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGL on X11 ........................... yes
LinuxFB ................................ yes
VNC .................................... yes
Mir client ............................. no
X11:
Using system-provided XCB libraries .. no
EGL on X11 ........................... yes
Xinput2 .............................. no
XCB XKB .............................. yes
XLib ................................. yes
XCB render ........................... yes
XCB GLX .............................. yes
XCB Xlib ............................. yes
Using system-provided xkbcommon ...... no
Native painting (experimental) ....... no
My hello_plugin_import has this:
// This file is autogenerated by qmake. It imports static plugin classes for
// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS.<plugin> variables.
#include <QtPlugin>
Q_IMPORT_PLUGIN(QEglFSIntegrationPlugin)
Q_IMPORT_PLUGIN(QXcbEglIntegrationPlugin)
Q_IMPORT_PLUGIN(QXcbGlxIntegrationPlugin)
Q_IMPORT_PLUGIN(QGifPlugin)
Q_IMPORT_PLUGIN(QICNSPlugin)
Q_IMPORT_PLUGIN(QICOPlugin)
Q_IMPORT_PLUGIN(QJpegPlugin)
Q_IMPORT_PLUGIN(QTgaPlugin)
Q_IMPORT_PLUGIN(QTiffPlugin)
Q_IMPORT_PLUGIN(QWbmpPlugin)
Q_IMPORT_PLUGIN(QWebpPlugin)
Q_IMPORT_PLUGIN(QEglFSEmulatorIntegrationPlugin)
Q_IMPORT_PLUGIN(QEglFSKmsEglDeviceIntegrationPlugin)
Q_IMPORT_PLUGIN(QEglFSX11IntegrationPlugin)
Q_IMPORT_PLUGIN(QConnmanEnginePlugin)
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin)
Update. I noticed that I can install a bunch of libxcb packages into my sysroot. I think if I do this, I can get xcb to show up as platform option (or even default platform option??). But does this mess up my static compile? Will my customer also need to have all these libraries installed or will qmake do the right thing?
libglu1-mesa-dev is already the newest version (9.0.0-2.1).
libx11-xcb-dev is already the newest version (2:1.6.4-3).
libxcb-dri2-0-dev is already the newest version (1.12-1).
libxcb-dri2-0-dev set to manually installed.
libxcb-dri3-dev is already the newest version (1.12-1).
libxcb-dri3-dev set to manually installed.
libxcb-glx0-dev is already the newest version (1.12-1).
libxcb-present-dev is already the newest version (1.12-1).
libxcb-present-dev set to manually installed.
libxcb-randr0-dev is already the newest version (1.12-1).
libxcb-randr0-dev set to manually installed.
libxcb-render0-dev is already the newest version (1.12-1).
libxcb-render0-dev set to manually installed.
libxcb-shape0-dev is already the newest version (1.12-1).
libxcb-shape0-dev set to manually installed.
libxcb-sync-dev is already the newest version (1.12-1).
libxcb-sync-dev set to manually installed.
libxcb-xfixes0-dev is already the newest version (1.12-1).
libxcb-xfixes0-dev set to manually installed.
libxcb1-dev is already the newest version (1.12-1).
libxi-dev is already the newest version (2:1.7.9-1).
libxrender-dev is already the newest version (1:0.9.10-1).
The following additional packages will be installed:
libxcb-composite0 libxcb-cursor0 libxcb-damage0 libxcb-dpms0 libxcb-ewmh2 libxcb-record0 libxcb-res0 libxcb-screensaver0 libxcb-xf86dri0 libxcb-xrm0 libxcb-xtest0
libxcb-xv0 libxcb-xvmc0
The following NEW packages will be installed:
libxcb-composite0 libxcb-composite0-dev libxcb-cursor-dev libxcb-cursor0 libxcb-damage0 libxcb-damage0-dev libxcb-dpms0 libxcb-dpms0-dev libxcb-ewmh-dev libxcb-ewmh2
libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-record0 libxcb-record0-dev libxcb-render-util0-dev libxcb-res0 libxcb-res0-dev libxcb-screensaver0
libxcb-screensaver0-dev libxcb-shm0-dev libxcb-util0-dev libxcb-xf86dri0 libxcb-xf86dri0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xrm-dev libxcb-xrm0 libxcb-xtest0
libxcb-xtest0-dev libxcb-xv0 libxcb-xv0-dev libxcb-xvmc0 libxcb-xvmc0-dev

I believe that when you configure Qt with -static, you are baking the platform plugin into the build and you won't be able to swap between plugins later on. I'm not certain about this, but I've been down that road and wasn't able to get the qpa switching working, there was only ever one platform plugin listed. If there is a way, I'd be very interested to hear about it!
If I'm correct in this, then to use xcb instead of eglfs, you'll need to reconfigure Qt with the first line of your configure something like:
./configure -no-eglfs -qpa xcb -qt-xcb -opensource -confirm-license -release -static \
Good luck

Related

No Available Video Device in SDL

The SDL-2 library I'm using was compiled from source.
Whenever I try to run any program that uses SDL-2 on X11, I am given this error:
SDL_Init Error: No available video device
I am running these programs through the command line on Linux Mint 19.3 Tricia.
Here's the ./configure summary:
SDL2 Configure Summary:
Building Shared Libraries
Building Static Libraries
Enabled modules : atomic audio video render events joystick haptic sensor power filesystem threads timers file loadso cpuinfo assembly
Assembly Math : mmx 3dnow sse sse2 sse3
Audio drivers : disk dummy oss
Video drivers : dummy opengl_es2 vulkan
Input drivers : linuxev linuxkd
Using libsamplerate : NO
Using libudev : NO
Using dbus : NO
Using ime : YES
Using ibus : NO
Using fcitx : NO
Looks like your SDL build is missing the X11 backend.
Mint looks sufficiently Debian-y that a sudo apt build-dep libsdl2 ought to pull in the required -dev packages. Then you can re-run ./configure & rebuild/reinstall SDL.
Make sure to double-check that the Video drivers line in the configure summary has the backends you're interested in using.
If the build-dep method is too hand-wavy then docs/README-linux.md has a (kinda old) itemized -dev package list:
================================================================================
Build Dependencies
================================================================================
Ubuntu 13.04, all available features enabled:
sudo apt-get install build-essential mercurial make cmake autoconf automake \
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
fcitx-libs-dev libsamplerate0-dev libsndio-dev
Ubuntu 16.04+ can also add "libwayland-dev libxkbcommon-dev wayland-protocols"
to that command line for Wayland support.
NOTES:
- This includes all the audio targets except arts, because Ubuntu pulled the
artsc0-dev package, but in theory SDL still supports it.
- libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime
for higher-quality audio resampling. SDL will work without it if the library
is missing, so it's safe to build in support even if the end user doesn't
have this library installed.
- DirectFB isn't included because the configure script (currently) fails to find
it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the
configure script to include DirectFB support. Send patches. :)

Qt + conan = using null output device, none available

I write my pet project. At first, it was based on cmake and I set the path to qt libs from the console, e.g. cmake -DPATH_TO_QT:STRING=/home/user/Qt/5.11.1/gcc_64/
The variable PATH_TO_QT was declared as set(PATH_TO_QT "/path/to/your/Qt/" CACHE STRING "Path to Qt")
With this configuration, my project worked very well.
However, I wanted to add in my project Conan Package Manager and I did it.
My conanfile.txt:
[requires]
Qt/5.11.1#bincrafters/stable
gtest/1.8.1#bincrafters/stable
libgit2/0.27.7#libgit2pkg/testing
[options]
Qt:qtmultimedia=True
Qt:qtsvg=True
Qt:qttools=True
[generators]
cmake
[imports]
bin, *.pdb -> ./bin
It works. The project builds fine. But in my project, I use QSound:
QSound::play(":/sounds/sounds/open-ended.wav");
In runtime, when the app gives this notification I don't hear it and in the console, I get the next message: using null output device, none available
But in other applications, sound exists.
How to fix this problem?
P.S. Kubuntu 18.04, GCC 7.3, Qt 5.11.1, conan 1.9.1, cmake 3.10.2
P.S2. config.summary
Build type: linux-g++ (x86_64, CPU features: mmx sse sse2)
Configuration: use_gold_linker sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples enable_new_dtags f16c largefile precompile_header rdrnd shani silent x86SimdAlways shared rpath release c++11 c++14 c++1z concurrent dbus no-pkg-config reduce_exports reduce_relocations stl
Build options:
Mode ................................... release
Optimize release build for size ........ no
Building shared libraries .............. yes
Using C++ standard ..................... C++1z
Using ccache ........................... no
Using gold linker ...................... yes
Using new DTAGS ........................ yes
Using precompiled headers .............. yes
Using LTCG ............................. no
Target compiler supports:
SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
AVX .................................. AVX AVX2
AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI
Other x86 ............................ AES F16C RDRAND SHA
Intrinsics without -mXXX option ...... yes
Build parts ............................ libs tools
Qt modules and options:
Qt Concurrent .......................... yes
Qt D-Bus ............................... yes
Qt D-Bus directly linked to libdbus .... no
Qt Gui ................................. yes
Qt Network ............................. yes
Qt Sql ................................. yes
Qt Testlib ............................. yes
Qt Widgets ............................. yes
Qt Xml ................................. yes
Support enabled for:
Using pkg-config ....................... no
udev ................................... no
Using system zlib ...................... no
Qt Core:
DoubleConversion ....................... yes
Using system DoubleConversion ........ no
GLib ................................... no
iconv .................................. yes
ICU .................................... no
Tracing backend ........................ <none>
Logging backends:
journald ............................. no
syslog ............................... no
slog2 ................................ no
Using system PCRE2 ..................... no
Qt Network:
getifaddrs() ........................... yes
IPv6 ifname ............................ yes
libproxy ............................... no
Linux AF_NETLINK ....................... yes
OpenSSL ................................ no
Qt directly linked to OpenSSL ........ no
OpenSSL 1.1 ............................ no
SCTP ................................... no
Use system proxies ..................... yes
Qt Gui:
Accessibility .......................... yes
FreeType ............................... yes
Using system FreeType ................ no
HarfBuzz ............................... yes
Using system HarfBuzz ................ no
Fontconfig ............................. no
Image formats:
GIF .................................. yes
ICO .................................. yes
JPEG ................................. yes
Using system libjpeg ............... no
PNG .................................. yes
Using system libpng ................ no
EGL .................................... no
OpenVG ................................. no
OpenGL:
Desktop OpenGL ....................... yes
OpenGL ES 2.0 ........................ no
OpenGL ES 3.0 ........................ no
OpenGL ES 3.1 ........................ no
OpenGL ES 3.2 ........................ no
Vulkan ................................. no
Session Management ..................... yes
Features used by QPA backends:
evdev .................................. yes
libinput ............................... no
INTEGRITY HID .......................... no
mtdev .................................. no
tslib .................................. no
xkbcommon-evdev ........................ no
QPA backends:
DirectFB ............................... no
EGLFS .................................. no
LinuxFB ................................ yes
VNC .................................... yes
Mir client ............................. no
X11:
Using system-provided XCB libraries .. no
EGL on X11 ........................... no
Xinput2 .............................. no
XCB XKB .............................. yes
XLib ................................. yes
XCB render ........................... yes
XCB GLX .............................. yes
XCB Xlib ............................. yes
Using system-provided xkbcommon ...... no
Native painting (experimental) ....... no
Qt Widgets:
GTK+ ................................... no
Styles ................................. Fusion Windows
Qt PrintSupport:
CUPS ................................... no
Qt Sql:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... no
ODBC ................................... no
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... no
Qt Testlib:
Tester for item models ................. yes
Qt Multimedia:
ALSA ................................... no
GStreamer 1.0 .......................... no
GStreamer 0.10 ......................... no
Video for Linux ........................ yes
OpenAL ................................. no
PulseAudio ............................. no
Resource Policy (libresourceqt5) ....... no
Windows Audio Services ................. no
DirectShow ............................. no
Windows Media Foundation ............... no
Note: Also available for Linux: linux-clang linux-icc
Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing.
I solved the problem myself. So if you have the same problem you can try to install the next dev-libs:
sudo aptitude install libfontconfig1-dev libdbus-1-dev libfreetype6-dev libudev-dev libicu-dev libsqlite3-dev libxslt1-dev libssl-dev libasound2-dev libavcodec-dev libavformat-dev \
libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev gstreamer-tools gstreamer0.10-plugins-good gstreamer0.10-plugins-bad libraspberrypi-dev libpulse-dev \
libx11-dev libglib2.0-dev libcups2-dev freetds-dev libsqlite0-dev libpq-dev libiodbc2-dev libmysqlclient-dev firebird-dev libpng12-dev libjpeg9-dev libgst-dev libxext-dev libxcb1 \
libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev \
libxcb-sync0 libxcb-sync1-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev libxi-dev libdrm-dev gstreamer0.10-alsa
If you don't want to install gstreamer0.10 you can install gstreamer1.0:
sudo aptitude install gstreamer1.0-omx gstreamer1.0-omx-generic libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad
had the same issue and after installing the qt multimedia plugin access to audio devices worked.
E.g: sudo apt install libqt5multimedia5-plugins

QT 5.8 - Cross compiling from Mac target Linux

I have a QT project that was originally developed for Mac and now we are porting it on Linux.
What I would like to do is to build (and Deploy) the project across both platform (Mac and Linux) using the Mac, possibly from QT Creator.
For this reason I need to configure QT Creator (creating a new Kit) adding a Linux Toolchain. I found the appropriate toolchain here:
Linux tool chain for Mac
Unfortunately that toolchain not contains the QT Framework. So I need to cross compile QT from the Mac using the Linux toolchain above.
To cross compile QT I tried this configure parameters (~/gcc-4.8.1-for-linux64/x86_64-pc-linux/ is the Linux toolchain path):
./configure -prefix ~/gcc-4.8.1-for-linux64/qt5.5.0 -xplatform linux-g++ -device-option CROSS_COMPILE=~/gcc-4.8.1-for-linux64/x86_64-pc-linux/ -opensource -confirm-license -no-opengl -make libs -make tools -nomake examples -nomake tests -sysroot ~/gcc-4.8.1-for-linux64/
Unfortunately the command miserably fails with this error
Note: QtSerialBus: Cannot find linux/can.h and linux/can/raw.h Linux headers for socketCAN support.
Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
WARNING: No QPA platform plugin enabled! This will
produce a Qt that cannot run GUI applications.
The dependencies needed for xcb to build are listed in
src/plugins/platforms/xcb/README
ERROR: detected a std::atomic implementation that fails for function pointers.
Please apply the patch corresponding to your Standard Library vendor, found in
qtbase/config.tests/common/atomicfptr
Any thought?
Cheers

Unable to build qt from the source (for the OpenCV)

I am trying to install OpenCV on my Windows 10 following this guide. In order to install it with my own-build libraries, I need to build qt from the source. I downloaded the latest sources from the qt page (5.6.0, I didn't find any other sources availible), but after typing
configure -release -no-webkit -no-phonon -no-phonon-backend -no-script - no-scripttools
-no-qt3support -no-multimedia -no-ltcg
In VS2013/VS2015 command promt, I got an error:
Unknown option -no-webkit
Unable to detect the platform from environment. Use -platform command line
argument or set the QMAKESPEC environment variable and run configure again.
I have an option just to make everything. But I have to specify the platform. I didn't find how to do it.
Can anyone give me a hint, how to install qt correctly? I have VS 2013 and 2015. I am going to use VS2013, since VS2015 is not supported by CUDA toolkit 7.5.
Thanks,
Mikhail
Update: I was able to begin the installation process by typing configure -platform win32-msvc2013 -mp -release (although I have win64), but after accepting the licence, I got an error: execute: File or path was not found(nmake). Screenshot is attached
have you tried with the MSVC2013 command prompt:
configure -platform win32-msvc2013 -mp -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-ltcg
then type:
nmake
Update:
Also, before that, try adding the path to your Qt source code, with the bin folder, to the PATH variable of windows.
For instance, if your PATH variable is currently set to %SystemRoot%\system32;%SystemRoot%; and your Qt source code is at C:\dev\Qt-5.6\
then set your PATH variable to %SystemRoot%\system32;%SystemRoot%;C:\dev\Qt-5.6;C:\dev\Qt-5.6\bin
This website explains how to change the PATH variable on Windows, in case you're not familiar with it: http://www.computerhope.com/issues/ch000549.htm
Then restart the MSVC2013 Command Prompt, or Windows. I believe that should help the compilation. Let me know if it solves your problem.
What about this:
-skip qtwebkit
Excluding a Qt Submodule
Configure's -skip option allows certain Qt submodules to be excluded from the Qt build. These submodules correspond to the Git submodules in the standard Qt 5 repository. Note that many packages contain multiple Qt modules. For example, to exclude Qt NFC and Qt Bluetooth from the Qt build, provide -skip qtconnectivity as the argument to configure.

Qt5WebKit module library is not built, when most others are built

I am building the Qt opensource on Ubuntu Linux. The target platform is the BeagleBone Black. Build process itself runs successfully, but I do not find the libQt5Webkit.so in the /lib/ directory.
Build and target platform details:
Host: Ubuntu Linux 15.04 x64
Target Hardware: BeagleBone Black
Target OS: Angstrom Linux
Toolchain: arm-linux-gnueabi
Qt Version: 5.4.2
Build Command: ./configure -v -opensource -confirm-license -prefix
/home/developer/projects/dependencies/qt/qt-5.4.2_Angstrom_BBB
-device linux-beagleboard_angstrom-g++
I am not disabling any modules as evident from the ./configure command options.
I have the following questions:
Is the building of the QtWebKit module disabled / removed?
How do I enable building the QtWebKit module project?
How can I cross-compile only the QtWebKit project?
If more information is required, I will provide.
Thanks.