Nominate our 2022 Qt Champions!

Building qtbase on Ubuntu 19.10 from source

  • Anyone know how to do this correctly. I did git clone then cd qtbase and git checkout 5.12.4. Next steps were qmake, make -j4, and sudo make -j4 install. The output from qmake indicates:
    Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing. I checked and AT-SPI is unstable in 19.10. My intention was to build pyside2 from source and supply those components ie. Qt5Core_DIR which apparently could not be detected on my system. The rest is output from sudo make install:
    In file included from qdbuserror.cpp:46: qdbus_symbols_p.h:61:12: fatal error: dbus/dbus.h: No such file or directory 61 | # include <dbus/dbus.h> | ^~~~~~~~~~~~~ In file included from qdbusintegrator_p.h:57, from qdbusintegrator.cpp:41: qdbus_symbols_p.h:61:12: fatal error: dbus/dbus.h: No such file or directory 61 | # include <dbus/dbus.h> | ^~~~~~~~~~~~~

    In file included from qdbusconnection_p.h:69, from qdbusconnection.cpp:42: qdbus_symbols_p.h:61:12: fatal error: dbus/dbus.h: No such file or directory 61 | # include <dbus/dbus.h>

  • Lifetime Qt Champion

  • Lifetime Qt Champion


    You are missing the dbus development package.

    On a side note, you should do out of source builds. That way you don't pollute your sources with build artifacts and if you have to restart your build from scratch you can just nuke the build folder.

  • @SGaist I am not sure what you mean. I do appear to have the Qt5 DBus package installed. The includes are at /usr/include/x86_64-linux-gnu/qt5/QtDBus. Where is the source package for Ubuntu or the source on Git for the DBus package? I also don't really want to build everything from source - just the parts for which no -dev package was available in the eoan Ubuntu distribution. There was a similar question to mine raised before and no answer.

  • @SGaist there was a similar question in 2018. @nathans 19 Jul 2018, 09:41

  • Lifetime Qt Champion

    QtDbus and DBus are two different things. The former uses the later hence my suggestion to install the the development package for DBus.

    You are currently building only qtbase which is already available for your distribution so what parts do you want to build exactly ?

  • @SGaist now it seems I have an issue with Cannot read /usr/local/Qt-5.12.4/mkspecs/common/linux.conf: No such file or directory and feature system-zlib missing even though that package is installed. Clearly the original issue of pyside2 missing Qt5Core_DIR was incorrect as it should have been there. Unlike some of the other packages qtscxml which I built from git and installed, qtbase has given more trouble than I expected. My thought was building pyside2 from source would ensure all packages were available on my system so that all examples would work and it is hard to understand how installing from pip3 could guarantee that as many packages were not installed by default. I want this setup in such a way that I can easily go back to qt5-default package. If you can clarify you should do out of source builds that might help.

    I created /usr/local/Qt-5.12.4/mkspecs/linux-g++/qmake.conf and edited /home/gordon/qtbase/mkspecs/features/resolve_config.prf to comment out 2 lines needed for the mac OS but this seems wrong and messy.

  • Lifetime Qt Champion

    From the looks of it you tried to install a half-built Qt.

    As for out of source builds, create a folder outside of Qt's sources, then start the configuration and build process from there.

    Can you provide a bit more information from your side ?

    • Why do you want to build PySide2 rather than using e.g. pip to install it ?
    • In case you really need to build it, why not use your distribution provided Qt ?
    • In case this is not an option, why not use one of the pre-built Qt version available through the installer provided by the Qt Company ?

  • @SGaist the reason I wanted to build pyside2 was because I wanted to have all the shared objects files required on my system. I could not see how pip install would have added these to my system. However, I have now deleted qtbase folder due to the difficulties, I did not want to half-build Qt just a few component packages missing from my distribution. The remaining issue is qmake -v giving as output:
    QMake version 3.1
    Using Qt version 5.12.4 in /usr/local/Qt-5.12.4/lib
    and even though I have used qtchooser I cannot figure out where the 5.12.4 in /usr/local/Qt-5.12.4/lib is coming from. It does not exist and should be /usr/lib/x86_64-linux-gnu or something similar. I solved this by removing qt5-qmake package and then installing it again. This had the effect of removing all the additional Qt packages I had added, the names of which I have filed. Thanks to all for assistance.

  • Lifetime Qt Champion

    The PySide2 package provides everything needed.

Log in to reply