rakefet
21st March 2014, 12:55
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,
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,