I would like to create a Dll on Windows using QMake+mingw, which includes some custom widgets and the dependent Qt libraries (linked into one library). Can this be achieved via QMake?
What I have tried so far:
Creating shared library project, and adding LIBS to .pro file:
QT += widgets
TARGET = testqtdll
TEMPLATE = lib
DEFINES += TESTQTDLL_LIBRARY
SOURCES += testqtdll.cpp widget.cpp
HEADERS += testqtdll.h testqtdll_global.h widget.h
FORMS += widget.ui
LIBS += -lqt5core -lqt5gui -lqt5widgets
This way the resulting dll does not include QT libs.
Creating static library project, and link qt static libs. Then create dll after:
QT += widgets
TARGET = testqtlib
TEMPLATE = lib
CONFIG += staticlib
SOURCES += testqtlib.cpp widget.cpp
HEADERS += testqtlib.h widget.h
FORMS += widget.ui
LIBS += c:/Qt/Static/5.3.1/lib/Qt5Core.a
LIBS += c:/Qt/Static/5.3.1/lib/Qt5Gui.a
LIBS += c:/Qt/Static/5.3.1/lib/Qt5Widgets.a
This way the resulting lib also does not include QT libs.
testqtdll
? We need to see the effective linkage of the resulting library – UmNyobe