During development of my project i used the shared lib version of Qt (2010.02.1/ 4.6.2) together with the QSerialDevice v0.2.0 library (build as a staticlib using a default "BuildIntegratedLibrary.pro"). I could create debug and release builds which had the QSerialDevice lib included in the .exe and only needed mingwm10.dll and various Qt dll's to run.

My OS: Win7 x64.

Now am trying to create a release build of my project which only depends on mingwm10.dll.

I have successfully created a static version of Qt (2010.02.1/ 4.6.2) (When i use QtCreator to create a new Qt GUI Application project and create a release build using this static qt version a nice 9.089KB untitled.exe is built). I used this Qt configuration:
Qt Code:
  1. cflags: -O2
  2. Qt configuration:
  3. -release -nomake examples -nomake demos -platform win32-g++
To copy to clipboard, switch view to plain text mode 

When i add the QSerialDevice lib to this simple test project:
Qt Code:
  1. QT += core gui
  2.  
  3. TARGET = untitled
  4. TEMPLATE = app
  5.  
  6. CONFIG += static
  7.  
  8. win32 {
  9. QMAKE_LFLAGS += -static-libgcc
  10. }
  11.  
  12. SOURCES += main.cpp\
  13. mainwindow.cpp
  14. HEADERS += mainwindow.h
  15. FORMS += mainwindow.ui
  16.  
  17. INCLUDEPATH = D:\src\qserialdevice.git\qserialdevice D:\src\qserialdevice.git\qserialdevicewatcher
  18. QMAKE_LIBDIR += D:\src\qserialdevice.git\build\lib\qintegratedserialdevice\release
  19.  
  20. LIBS += -lqserialdevice
To copy to clipboard, switch view to plain text mode 

And start using the QSerialDevice classes in my code and then create a static release build. The build will fail. QtCreator will show a Build Issue: "collect2: Id returned 1 exit status". And the compile output will show a whole lot of "undefined references":

Snippet:
Qt Code:
  1. d:\src\qserialdevice.git\build\lib\qintegratedserialdevice\release/libqserialdevice.a(abstractserial.o):abstractserial.cpp:(.text+0x22): undefined reference to `_imp___ZN8QMapData11shared_nullE'
  2. d:\src\qserialdevice.git\build\lib\qintegratedserialdevice\release/libqserialdevice.a(abstractserial.o):abstractserial.cpp:(.text+0x7e): undefined reference to `_imp___ZN8QMapData11shared_nullE'
  3. d:\src\qserialdevice.git\build\lib\qintegratedserialdevice\release/libqserialdevice.a(abstractserial.o):abstractserial.cpp:(.text+0x18c): undefined reference to `_imp___ZN7QString11shared_nullE'
  4. d:\src\qserialdevice.git\build\lib\qintegratedserialdevice\release/libqserialdevice.a(abstractserial.o):abstractserial.cpp:(.text+0x290): undefined reference to `_imp___ZN7QString11shared_nullE'
  5. d:\src\qserialdevice.git\build\lib\qintegratedserialdevice\release/libqserialdevice.a(abstractserial.o):abstractserial.cpp:(.text+0x394): undefined reference to `_imp___ZN7QString11shared_nullE'
  6. d:\src\qserialdevice.git\build\lib\qintegratedserialdevice\release/libqserialdevice.a(abstractserial.o):abstractserial.cpp:(.text+0x498): undefined reference to `_imp___ZN7QString11shared_nullE'
  7. d:\src\qserialdevice.git\build\lib\qintegratedserialdevice\release/libqserialdevice.a(abstractserial.o):abstractserial.cpp:(.text+0x646): undefined reference to `_imp___ZN7QString11shared_nullE'
To copy to clipboard, switch view to plain text mode 

Is there a configuration option i missed in my .pro file which is needed to statically build your project using a static version of qt and a third party static library?