Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Problem compiling Qt statically for Ubuntu



  • I am having problems building Qt from source for Ubuntu.
    Whenever I configure Qt using the

    ./configure -static
    

    command, the compile process always fails with one or another error (examples below).
    Dynamic compiling seems to work fine.

    Most of the errors I have gotten so far seem to come from qt plugins, but whenever I skip that plugin for building, I just get an error from another plugin.

    I am running Ubuntu 20.04 with Kernel 5.8.10, but I have also tested compiling under Ubuntu 18.04 with Kernel 5.4.0 but got the same results.
    The errors occur both using version 5.15.0 and 5.15.1.

    Here are some of the errors, I have gotten so far:

    g++: error: /home/nils/Qt/5.15.1/Src/qtmultimedia/plugins/mediaservice/libmockserviceplugin1.a: Datei oder Verzeichnis nicht gefunden
    g++: error: /home/nils/Qt/5.15.1/Src/qtmultimedia/plugins/mediaservice/libmockserviceplugin2.a: Datei oder Verzeichnis nicht gefunden
    g++: error: /home/nils/Qt/5.15.1/Src/qtmultimedia/plugins/mediaservice/libmockserviceplugin3.a: Datei oder Verzeichnis nicht gefunden
    g++: error: /home/nils/Qt/5.15.1/Src/qtmultimedia/plugins/mediaservice/libmockserviceplugin4.a: Datei oder Verzeichnis nicht gefunden
    g++: error: /home/nils/Qt/5.15.1/Src/qtmultimedia/plugins/mediaservice/libmockserviceplugin5.a: Datei oder Verzeichnis nicht gefunden
    g++: error: /home/nils/Qt/5.15.1/Src/qtmultimedia/plugins/mediaservice/libqtmedia_audioengine.a: Datei oder Verzeichnis nicht gefunden
    g++: error: /home/nils/Qt/5.15.1/Src/qtmultimedia/plugins/playlistformats/libqtmultimedia_m3u.a: Datei oder Verzeichnis nicht gefunden
    Makefile:131: recipe for target 'audio-visualizer-qml' failed
    make[4]: * [audio-visualizer-qml] Error 1
    make[4]: Verzeichnis „/home/nils/Qt/5.15.1/Src/qt3d/examples/qt3d/audio-visualizer-qml“ wird verlassen
    Makefile:170: recipe for target 'sub-audio-visualizer-qml-make_first' failed
    make[3]: * [sub-audio-visualizer-qml-make_first] Error 2
    make[3]: Verzeichnis „/home/nils/Qt/5.15.1/Src/qt3d/examples/qt3d“ wird verlassen
    Makefile:46: recipe for target 'sub-qt3d-make_first' failed
    make[2]: * [sub-qt3d-make_first] Error 2
    make[2]: Verzeichnis „/home/nils/Qt/5.15.1/Src/qt3d/examples“ wird verlassen
    Makefile:100: recipe for target 'sub-examples-make_first' failed
    make[1]: * [sub-examples-make_first] Error 2
    make[1]: Verzeichnis „/home/nils/Qt/5.15.1/Src/qt3d“ wird verlassen
    Makefile:630: recipe for target 'module-qt3d-make_first' failed
    make: * [module-qt3d-make_first] Error 2
    
    plugin.cpp:(.text._ZL33qt_plugin_instance_QtQuick2Pluginv+0x90): Warnung: undefinierter Verweis auf »qml_register_types_QtQuick()«
    collect2: error: ld returned 1 exit status
    Makefile:135: recipe for target '../../bin/qml' failed
    make[3]: * [../../bin/qml] Error 1
    make[3]: Verzeichnis „/home/nils/Qt/5.15.0/Src/qtdeclarative/tools/qml“ wird verlassen
    Makefile:180: recipe for target 'sub-qml-make_first' failed
    make[2]: * [sub-qml-make_first] Error 2
    make[2]: Verzeichnis „/home/nils/Qt/5.15.0/Src/qtdeclarative/tools“ wird verlassen
    Makefile:74: recipe for target 'sub-tools-make_first' failed
    make[1]: * [sub-tools-make_first] Error 2
    make[1]: Verzeichnis „/home/nils/Qt/5.15.0/Src/qtdeclarative“ wird verlassen
    Makefile:339: recipe for target 'module-qtdeclarative-make_first' failed
    make: * [module-qtdeclarative-make_first] Error 2
    

    If any of you have an idea what I could try next, that would be gladly appreciated.


Log in to reply