⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

Building QT in static mode - qtsvg

  • Hi everyone,

    First of all, I am using Qt for windows:

    • QT 5.6.0 - Mingw: qt-opensource-windows-x86-mingw492-5.6.0
    • QWT 6.1.2 : qwt-6.1.2.zip

    I am trying to build QT in static mode in order to remove the dependencies of QT dlls for my application.

    The build is fine so far.
    I just followed those steps:

    • cd C:\path\to\Qt
    • C:\Qt\Qt5.6.0\5.6\Src\qtbase\configure -static -opengl desktop -openvg -nomake examples -nomake tests
    • mingw32-make

    Although I got some errors, I could easily fix them (basically some missing path for includes).

    Now, the problem I am facing is that when I build QT sources, some components/plugins are not built. Especially one I need, which is qtsvg.
    I can see in the Windows installer prebuilt libraries (which are built for dynamic usage of QT), that I have the libQt5Svg.a library. It is located with others in "C:\Qt\Qt5.6.0\5.6\mingw49_32\lib".
    When I build mine, I have not this library. I am pretty much sure it is because it has not been included in the QT build. But I didn't see in the configure "help" a way to include "svg". There are options for OpenGL for example, but no SVG.

    I guess I am missing something but I don't know what.

    Any help will be appreciated.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    That's because you have only built the qtbase module. You have two choices to go further:

    1. Rebuild all of Qt i.e. call configure from Src (takes time and hard drive space)
    2. Build only the modules you need (less time and less hard drive space)

    For number 2, just cd in the module(s) folder you want to build, call qmake (the one from your static build) and mingw32-make

Log in to reply