Results 1 to 4 of 4

Thread: Build a release version of QT app with the static libraries of QT

  1. #1
    Join Date
    Feb 2014
    Posts
    26
    Qt products
    Qt5
    Platforms
    Windows

    Default Build a release version of QT app with the static libraries of QT

    Hi,

    The problem I have is that I can not build a static version of a simple QT application.

    I have on my computer two versions of Qt5. One version was built with the default setting (dynamic libs) and the other version was built with the static option. I put each version in different location on my computer.
    I built a simple qt app in qt creator. The .pro file looks like that:

    QT += core gui
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = mydialog


    TEMPLATE = app


    SOURCES += main.cpp\
    mydialog.cpp

    HEADERS += mydialog.h

    FORMS += \
    mydialog.ui


    CONFIG += static
    static {
    CONFIG += static
    DEFINES += STATIC
    message("Static build.")
    }

    I changed the qt version on qt_creator to look at the location of qmake.exe at the location of the qt with the static version.
    When I run qmake from qt_creator I am getting the error: Error while building/deploying project mydialog When executing step 'qmake'.

    When I run qmake from the command line qmake creates Makefile but the Makefile points into the qt libraries in the dynamic version.

    I want to point out that in my computer the path and QDIR are set to be the location of the dynamic version of QT.

    I would like to be able to link the dynamic version of qt in the debug version of the project and the static version of qt in the release version of my project.

    How can I do that?

    Thank you in advance,

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Build a release version of QT app with the static libraries of QT

    When you run qmake on the command line, do you run the correct version? I.e. the one from the static build?

    Cheers,

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Build a release version of QT app with the static libraries of QT

    You can check which version of qmake you use by running qmake -v
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Feb 2014
    Posts
    26
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Build a release version of QT app with the static libraries of QT

    Yes. When I type qmake -v , I am getting the qmake with the static version.
    I changed my computer environment path to the static version and now the Makefile points to the right version. However, when I tried to build the project, I've got errors in the qtcore header. Since I built the static version with source that was taken from git last week and could have bugs in it, I am going now to build the static version with the same source that I was building the dynamic version and see what happens. I'll keep you posted.

Similar Threads

  1. [Qt 5.0] Build and Compile Static Qt Libraries Error
    By Salads in forum Installation and Deployment
    Replies: 1
    Last Post: 12th February 2013, 21:37
  2. build qt program in release version run carsh
    By leeguevara in forum Qt Programming
    Replies: 3
    Last Post: 21st December 2011, 03:52
  3. Replies: 0
    Last Post: 2nd March 2009, 12:49
  4. Static build of commercial version of Qt4.3.4
    By MrShahi in forum Installation and Deployment
    Replies: 1
    Last Post: 7th May 2008, 12:46
  5. build debug with shared and release with static?
    By Thor28 in forum Qt Programming
    Replies: 4
    Last Post: 14th April 2008, 22:32

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.