Important: Please read the Qt Code of Conduct -


  • Hello,

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

    ../../srcs/qt/configure --prefix=/sw/local/qt/
    -qpa cocoa
    -nomake examples
    -nomake tests
    -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

    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


    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