couldnt build static Qt 5.13.1



  • Hello.
    I tried to build static Qt 5.13.1 from sources and failed :(
    i did it on two systems - Astra Linux and Ubuntu 16.04
    I made this actions:

    1. installed QtCreator with online installer

    2. downloaded sources from here http://download.qt.io/official_releases/qt/5.13/5.13.1/single/qt-everywhere-src-5.13.1.tar.xz

    3. extracted them

    4. installed all necessary dependencies from here https://doc.qt.io/qt-5/linux-requirements.html#

    5. launched config and got this
      room303@room303:~/build$ ../QtSrc/configure -static -release -c++std c++14 -prefix "/home/room303/Qt5.13.1static" -opensource -confirm-license -opengl -nomake examples -nomake tests -qt-xcb -qt-libpng -no-libjpeg -qt-zlib -qt-pcre -gtk -qt-harfbuzz -qt-freetype -fontconfig -pulseaudio -alsa

      • cd qtbase
      • /home/room303/QtSrc/qtbase/configure -top-level -static -release -c++std c++14 -prefix /home/room303/Qt5.13.1static -opensource -confirm-license -opengl -nomake examples -nomake tests -qt-xcb -qt-libpng -no-libjpeg -qt-zlib -qt-pcre -gtk -qt-harfbuzz -qt-freetype -fontconfig -pulseaudio -alsa
        Preparing build tree...
        Creating qmake...
        ...........................................................................................Done.
        Info: creating super cache file /home/room303/build/.qmake.super
        ERROR: Unknown command line option '-static'.

      Actually this error is produced by any key that is on first place after ./configure

      After this i tried everything that i could:
      -cofiguring from source directory
      -doing everything from sudo
      -installing additional dependcies from another guides, that i found in google, like

      sudo apt-get install gcc g++ make wget
      sudo apt-get install build-essential
      sudo apt-get install
      "^libxcb.*" libx11-dev libx11-xcb-dev libxcursor-dev libxrender-dev libxrandr-dev
      libxext-dev libxi-dev libxss-dev libxt-dev libxv-dev libxxf86vm-dev libxinerama-dev libxkbcommon-dev
      libfontconfig1-dev libharfbuzz-dev
      libasound2-dev libpulse-dev libdbus-1-dev udev mtdev-tools webp
      libudev-dev libglm-dev libwayland-dev libegl1-mesa-dev mesa-common-dev
      libgl1-mesa-dev libglu1-mesa-dev libgles2-mesa libgles2-mesa-dev libmirclient-dev
      libproxy-dev libgtk2.0-dev libgtk-3-dev libcups2-dev

      -updating system ofc
      -using another sources of another Qt versions
      -updating gcc

      Best result was from building only qtbase:

      room303@room303:~/build$ /home/room303/QtSrc/qtbase/configure -top-level -static -release -c++std c++14 -prefix /home/room303/Qt5.13.1static -opensource -confirm-license -opengl -nomake examples -nomake tests -qt-xcb -qt-libpng -no-libjpeg -qt-zlib -qt-pcre -gtk -qt-harfbuzz -qt-freetype -fontconfig -pulseaudio -alsa

      configured successfully -> make -> make install -> adding static build in QtCreator. BUT i couldnt build my project with error that looks smth like "linking to unknown QT module xmlpatterns", which
      i suppose is a consequence of configuring from qtbase.

      On Ubuntu i made mostly the same actions, but resulting error was: "ERROR:You cannot configure qt separately within top-level build"
      Any ideas about what i am doing wrong or prerequsites i missed?
      Thanks for your help.