Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Compile static lib errors.
CM972 last edited by
I am tring to deploy a static library created with qt under windows.
Here is the .pro file
@TEMPLATE = lib
DEPENDPATH += .
INCLUDEPATH += .
TARGET = MyLib
CONFIG =qt staticlib opengl release
QMAKE_LFLAGS = -static
SOURCES += My Sources
HEADERS += My headers
QT =core gui opengl@
This generates a .a file that is only 39ko.
When I build the same source code on mac it weights about 1Mo and it works fine.
When I link the generated .a to another project I get a lot of undefined reference error.
How can I compile my project statically on windows to make it work ?
picasoft last edited by
That's my build.bat file which I use to build Qt staticaly
configure.exe -static -no-qt3support -qt-libpng -qt-libjpeg -qt-gif -qt-zlib -no-phonon-backend -platform win32-msvc2005 -debug-and-release nmake
Now I use them in MS Visual Studio 2005 and it works fine.
Just specify Multi-threaded (/MT) option in properties dialog.