Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Building Qt for static linking on Windows. Quick and Qml are missing? How to link plugins statically?
Forum Updated to NodeBB v4.3 + New Features

Building Qt for static linking on Windows. Quick and Qml are missing? How to link plugins statically?

Scheduled Pinned Locked Moved Installation and Deployment
3 Posts 2 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rmdev
    wrote on last edited by
    #1

    Hello,

    I'm having a few problems trying to get Qt to statically link the libraries. I've searched the internet and the forum for the past days, but couldn't find a solution that worked. Maybe there is a problem in the way I am building it and I hope someone can help me out.

    I have downloaded the qt-everywhere-opensource-src-5.2.1.7z package and unzipped it to C:\Qt\QtStatic\

    Since I have Qt Creator 5.2.1 installed already, I've set the PATH variable to point to C:\Qt\Qt5.2.1\Tools\mingw48_32\bin for mingw32-make

    I open the command windows and navigate to C:\Qt\QtStatic\

    From there I run configure.bat with the following options:
    configure -static -platform win32-g++ -opengl desktop -nomake examples -nomake tests -opensource

    After that:
    mingw32-make

    When that's done:
    mingw32-make install

    Now I start up the Qt Creator and open the "Qt Quick Controls - Gallery" example.
    I then go to Projects and create a Kit that's linking to the qmake located in the static build I made above.
    C:\Qt\QtStatic\qtbase\bin\qmake.exe

    I then notice that it already gives me a warning saying: qmlscene is not installed, no qmlviewer installed.

    I select the new kit to be the current setting for compilation and try to build the application and then get the following error in build problems:
    Unknown module(s) in QT: quick qml

    --

    Now my question is, how can I get the project to find those? Do I need to build the library again with other settings? Do I add quick and qml elsewhere?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rmdev
      wrote on last edited by
      #2

      It seems to work now. Here's what I did:

      I now added a reference to Python to the PATH-variable and recompiled the whole thing with added configure options:

      configure -static -platform win32-g++ -opengl desktop -nomake examples -nomake tests -opensource -debug-and-release -developer-builld

      Then I only used mingw32-make
      No need for mingw32-make install


      Static linking seems to work now, apart from the plugins.
      I haven't found out how to tell the project to also put stuff like platforms/qwindows.dll and the QtQuick and QtQuick.2 folder into the executable as well.

      So right now the application folder still looks like this:
      platforms/qwindows.dl
      QtQuick/..(a lot of stuff)
      QtQuick.2/..(a lot of stuff)
      executable.exe
      libgcc_s_dw2-1.dll
      libstdc++-6.dll
      libwinpthread-1.dll

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mib383
        wrote on last edited by
        #3

        I have the same problem with plugins.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved