Completely Statically Built Application



  • Hi,

    I would like to write an application that is completely statically built using Qt 5.0.

    In the past, I have been successful in making applications that require shared objects to be distributed with the application (in a specially named folder, egad). My goal is to make one that requires none. Absolutely none. No installing to any system directories, no runtime additions to the path, no shared libraries. None. I should be able to move the executable binary around freely.

    First: is this possible with Qt 5.0?
    Second: if so, how?

    Thanks,


  • Moderators

    It is.

    You need to compile Qt5 statically, and then compile your app statically too. AFAIK, there are some hurdles in doing that currently in Qt5. Qt4 should be easier.



  • I had no problems with building 5.0.1 statically, but QML applications don't show any output, may have something to do with enabling desktop Opengl.



  • [quote author="Geometrian" date="1366725933"]Hi,

    I would like to write an application that is completely statically built using Qt 5.0.

    In the past, I have been successful in making applications that require shared objects to be distributed with the application (in a specially named folder, egad). My goal is to make one that requires none. Absolutely none. No installing to any system directories, no runtime additions to the path, no shared libraries. None. I should be able to move the executable binary around freely.

    First: is this possible with Qt 5.0?[/quote]

    Sure... you can.

    [quote author="Geometrian" date="1366725933"]Second: if so, how?[/quote]

    Recompile Qt source code with static option ... I did that in Linux as following:

    [code]./configure -opensource -static -developer-build -v -qt-sql-psql -qt-sql-sqlite -qt-zlib -qt-libpng -qt-libjpeg -qt-pcre -qt-xcb[/code]

    For more information... https://qt-project.org/doc/qt-5.0/qtdoc/deployment-x11.html#static-linking


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.