Static



  • Hello,

    I am trying to build Qt statically on OS X. Here is the command I use

    ../../srcs/qt/configure --prefix=/sw/local/qt/
    -release
    -opensource
    -confirm-license
    -c++11
    -static
    -qpa cocoa
    -nomake examples
    -nomake tests
    -no-compile-examples
    -skip qtconnectivity
    -skip qtandroidextras
    -skip qtlocation
    -skip qtwebchannel
    -skip qtwebengine
    -skip qtwebsockets
    -skip qtsvg
    -skip qtenginio
    -skip qtdeclarative
    -skip qtserialport
    -skip qtmultimedia
    -skip qtscript
    -skip qtquick1
    -no-largefile
    -no-qml-debug
    -no-journald
    -no-cups
    -no-iconv
    -no-dbus
    -no-sql-psql
    -no-wayland
    -no-harfbuzz
    -no-xcb
    -no-opengl
    -no-gtkstyle
    -no-pulseaudio
    -no-glib
    -no-xcb-xlib
    -no-alsa
    -qt-sql-sqlite
    -qt-zlib
    -qt-pcre
    -qt-freetype
    -qt-libjpeg
    -qt-libpng

    As you can guess, our needs are small. We deactivate most features (I think). We really only need the Widgets/GUI library to build our application. For most of the rest, we prefer to rely on the STL and hand-coded stuff (with the good and the bad that entails).

    Now, at the end of the configure process, it says :

    WARNING: Using static linking will disable the use of dynamically
    loaded plugins. Make sure to import all needed static plugins,
    or compile needed modules into the library.

    I would very much like to compile needed modules into the library, I just don't know how to go about it. Can someone hint me towards a solution.

    In advance, thanks.


  • Lifetime Qt Champion

    Hi,

    It depends on what you will use, see for example the SQL related plugins. You can either use the -plugin-sql-mysql or -qt-sql-mysql. The second option will make the support built-in.



  • Thanks (again).

    From that answer, I gather that the options that I give at compile time (e.g. -qt-sql-sqlite -qt-zlib -qt-pcre -qt-freetype -qt-libjpeg -qt-libpng) are using built-in support and thus are OK for my static library use case.

    If this is incorrect, please let me know.


  • Lifetime Qt Champion

    Nop, looks good.

    Don't forget to also use Q_IMPORT_PLUGIN and its friends when building your application.


Log in to reply
 

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