Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to use qt5 static library?

How to use qt5 static library?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 2 Posters 2.8k Views
  • 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.
  • D Offline
    D Offline
    dscyw
    wrote on last edited by dscyw
    #1

    I checked out qt5.7.0 source code from git via the following command

    $ git clone https://code.qt.io/qt/qt5.git # cloning the repo
    $ cd qt5
    $ git checkout v5.7.0 # checking out the specific release or branch
    $ git submodule update --init # updating each submodule

    and built successfully via the following command

    D:\JandunWork\qt5> configure.bat -prefix C:\Qt\Qt570_Static -static -debug-and-release -openssl -I C:\Libs\openssl_1.0.1j\include -L C:\Libs\openssl_1.0.1j\lib -opensource -confirm-license -make libs -nomake examples -nomake tests
    D:\JandunWork\qt5> nmake
    D:\JandunWork\qt5> nmake install

    Question One


    How to configure my Visual Studio 2015 or Qt Creator to program with qt5.7.0 static library? What I mean is that after I configure Visual Studio 2015 or Qt Creator I can simply create qt project via visual operation File>New>Project based on qt static library I built. It is as simple as using dynamic qt library installed from official setup.

    I can build my static qt application by adding include path, library path and library name for every project in Visual Studio 2015 for every new project or by executing qmake *pro; nmake in command prompt.

    Question Two


    As you know, I can build my static qt application via

    D:\JandunWork\Qt570StaticTestProject> qmake test.pro
    D:\JandunWork\Qt570StaticTestProject> nmake

    Oddities happened to qt quick project while qt widget project worked well.
    When I only use Rectangle QML Type, I got something like
    Rectangle.

    It looks well, but when I tried to resize it, it became something like
    Resize Rectangle.

    What's worse, ApplicationWindow and Window QML Type cannot be rendered and I just got
    Window.

    So what's wrong with qt quick module from my static qt library? Or is it because I didn't use it in correct way?

    If necessary I can provide with more information about my qt build configuration and test cases. Thanks for your patience. Any help is appreciated.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You need to go to the settings. Add a new Qt version pointing to your static build and create a Kit to use it.

      You should rather clone the latest 5.7, that way you'll have the bug fixes that went it in between.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        You need to go to the settings. Add a new Qt version pointing to your static build and create a Kit to use it.

        You should rather clone the latest 5.7, that way you'll have the bug fixes that went it in between.

        D Offline
        D Offline
        dscyw
        wrote on last edited by dscyw
        #3

        @SGaist said in How to use qt5 static library?:

        Hi,

        You need to go to the settings. Add a new Qt version pointing to your static build and create a Kit to use it.

        You should rather clone the latest 5.7, that way you'll have the bug fixes that went it in between.

        I had add Qt570_Static version manually as the following picture shows.
        0_1473173928693_Qt570StaticVersion.png

        Please pay attention to the sentence No qmlscene installed. I have no idea whether it matters.

        After I added Qt570_Static version, there is a default kit as the following picture shows.
        0_1473173943536_Qt570StaticKit.png

        Obviously, there is something missing about this kit.

        I create two project with this kit, but there are link errors when building.0_1473173405383_Qt570StaticProjectBuild.png

        Any advanced advice? Thank you in advance.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          qmlscene is a helper tool which is not mandatory to build your applications.

          AFAIK, that's a library from the DirectX SDK.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply
          0
          • SGaistS SGaist

            qmlscene is a helper tool which is not mandatory to build your applications.

            AFAIK, that's a library from the DirectX SDK.

            D Offline
            D Offline
            dscyw
            wrote on last edited by
            #5

            @SGaist said in How to use qt5 static library?:

            qmlscene is a helper tool which is not mandatory to build your applications.

            AFAIK, that's a library from the DirectX SDK.

            Thank you for your reply.

            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