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

Qt Building Static App for Linux?



  • I’m building an App on Windows and Linux. I was able to make a zip file containing the app and DLLs for a simple deploy on Windows. Now I’d like to link the app statically for a simple deploy on Linux.

    Starting here: https://doc.qt.io/qt-5/linux-deployment.html

    I’m confused first of all by this procedure:

    alt text

    I found a configure file here and then did this:

    alt text

    That looked like it finished, but I can't find the result and don't know how to use it.

    Details are here: Blog Post

    Thanks.



  • You're saying that you don't have the libs built under ./5.14.2static?

    Did you do a make install?

    BTW: you may want to add the -static-runtime option to your configure command.



  • @mzimmers I'm not a complete noob to linux, but when you say ./something I don't know what "." is so I'm lost. What should I look for if Qt is installed in /home/myname/Qt?



  • I'm not a Linux maven myself, but I'll give it my best: the dot (".") refers to the current directory, so "./5.14.2static" means a directory "5.14.2static" under the current directory (which appears to be "/Qt/5.14.2/Src" in your case). This is where the configure command is telling make to put the built objects.

    But:

    I don't believe that this will actually occur unless/until you execute a make install command. (I know it won't under Windows.)



  • @mzimmers Oh. Right. The instructions say do "make" after the ./configure thing. So here goes. No .5.14.2static dir was created by the ./configure. The instructions say follow that up by a make, which I forgot. Now it's really busy. No clue what it's doing but I'll report back after 600 seconds, when I can post again.

    OMG. It's still running after over an hour and I have a very fast machine. Ryzen 7 1800. And this LinuxVM is running with an SSD VDI hard drive.

    Well I don't see the "make install" part on the web page I'm using. Odd.
    https://doc.qt.io/qt-5/linux-deployment.html

    What does "make install" do?



  • @Windy make, and then make install. Two separate commands.


  • Lifetime Qt Champion

    Hi,

    You should consider using the linuxdeployqt project.

    Don't forget that with static builds, unless you hold a commercial license, there are constraints to be taken into account.



  • @Windy heh...yeah, Qt is a very big set of libraries. It takes several times longer to build than do most flavors of Linux. You can mitigate this in the future by removing certain components that you don't expect to need.


  • Lifetime Qt Champion

    @mzimmers said in Qt Building Static App for Linux?:

    @Windy heh...yeah, Qt is a very big set of libraries. It takes several times longer to build than do most flavors of Linux. You can mitigate this in the future by removing certain components that you don't expect to need.

    Especially the web engine module.



  • @SGaist You know, the deeper I go into Qt, the less I like it.
    I've used it for years and years., but maybe it's time to move on.
    There are other less onerous platforms out there with fewer Legal Restrictions.
    I am a retired SW engineer and now a hobbyist writing code to solve my own problems and sharing the source with the world.

    If Qt doesn't want to continue to make that easier for me, maybe it's time to learn another platform. I have used C++ for decades, but maybe it's time for Python or something more friendly and FREAKING EASIER TO DEPLOY.

    This thing is still running. It only took 20 minutes to install this whole environment over the net and it's been over two hours to prepare a static deployment and it's still running.

    I FREAKING GIVE UP.
    I can use it myself, on Windows and Linux, so what do I care about spending this much nonsense time.
    I have looked at linuxdeployqt and it looks to me like they wrote part of it as code and the rest as a program to be executed by the user. The SCRIPT for me to run was 5 or 10 pages of stuff I couldn't understand inspite of having used Linux and QT for years. I've done deployments on Linux in the past with Qt on Ubuntu and Debian. I get it, but it has not gotten easier in the past decade.
    Fooy on this whole thing. I'm gonna go learn python with a graphical builder and see where that goes.
    CTRL/C
    exit

    Oh just finished:
    Makefile:117: recipe for target 'qwindow-compositor' failed
    make[4]: *** [qwindow-compositor] Error 1
    make[4]: Leaving directory '/home/darrell/Qt/5.14.2/Src/qtwayland/examples/wayland/qwindow-compositor'
    Makefile:59: recipe for target 'sub-qwindow-compositor-make_first' failed
    make[3]: *** [sub-qwindow-compositor-make_first] Error 2
    make[3]: Leaving directory '/home/darrell/Qt/5.14.2/Src/qtwayland/examples/wayland'
    Makefile:46: recipe for target 'sub-wayland-make_first' failed
    make[2]: *** [sub-wayland-make_first] Error 2
    make[2]: Leaving directory '/home/darrell/Qt/5.14.2/Src/qtwayland/examples'
    Makefile:73: recipe for target 'sub-examples-make_first' failed
    make[1]: *** [sub-examples-make_first] Error 2
    make[1]: Leaving directory '/home/darrell/Qt/5.14.2/Src/qtwayland'
    Makefile:656: recipe for target 'module-qtwayland-make_first' failed
    make: *** [module-qtwayland-make_first] Error 2
    darrell@LM19VB:~/Qt/5.14.2/Src$ ^C
    darrell@LM19VB:~/Qt/5.14.2/Src$

    Whatever



  • 3wslco.jpg


  • Qt Champions 2017

    @Windy said in Qt Building Static App for Linux?:

    This thing is still running. It only took 20 minutes to install this whole environment over the net and it's been over two hours to prepare a static deployment and it's still running.

    As a fellow Ryzen user, did you remember to run make -j16 to make use of them cores? :)

    Actually building on linux is a breeze, compared to MSVC, still needs some getting used to, I guess.



  • I tried building Webkit for mingw on Windows. It took like 3 or 4 hours with all 12 cores of my processor going. Big stuff takes a while. Can be annoying.


Log in to reply