title: application "crashes" after statically linking library
body: <p>I try to statically link a library to my application in Qt. 
  Unfortunately, it does not work on Windows but only on Linux. </p>
  
  <p>I want to add the <a href="http://www.iausofa.org/current_C.html#Downloads" rel="nofollow noreferrer">IAU_SOFA</a> libraries. 
  Therefore, I first use the Qt Creator and add a new Project: I select "Library", "C++ Library" give it a name and select <code>CMake</code> as my Build-System. Furthermore, I change the Type to "Statically Linked Library" and select "None" as my Qt module. </p>
  
  <p>Then I copy all source files to the project folder and add my <code>CMakeLists.txt</code> file to look like this: </p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  project(sofa_c)
  
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  
  set(SOURCE_FILES
      sofa.h sofam.h a2af.c a2tf.c ab.c ae2hd.c af2a.c anp.c anpm.c apcg.c apcg13.c apci.c apci13.c apco.c apco13.c apcs.c apcs13.c aper.c aper13.c apio.c apio13.c atci13.c atciq.c atciqn.c atciqz.c atco13.c atic13.c aticq.c aticqn.c atio13.c atioq.c atoc13.c atoi13.c atoiq.c bi00.c bp00.c bp06.c bpn2xy.c c2i00a.c c2i00b.c c2i06a.c c2ibpn.c c2ixy.c c2ixys.c c2s.c c2t00a.c c2t00b.c c2t06a.c c2tcio.c c2teqx.c c2tpe.c c2txy.c cal2jd.c cp.c cpv.c cr.c d2dtf.c d2tf.c dat.c dtdb.c dtf2d.c eceq06.c ecm06.c ee00.c ee00a.c ee00b.c ee06a.c eect00.c eform.c eo06a.c eors.c epb.c epb2jd.c epj.c epj2jd.c epv00.c eqec06.c eqeq94.c era00.c fad03.c fae03.c faf03.c faju03.c fal03.c falp03.c fama03.c fame03.c fane03.c faom03.c fapa03.c fasa03.c faur03.c fave03.c fk52h.c fk5hip.c fk5hz.c fw2m.c fw2xy.c g2icrs.c gc2gd.c gc2gde.c gd2gc.c gd2gce.c gmst00.c gmst06.c gmst82.c gst00a.c gst00b.c gst06.c gst06a.c gst94.c h2fk5.c hd2ae.c hd2pa.c hfk5z.c icrs2g.c ir.c jd2cal.c jdcalf.c ld.c ldn.c ldsun.c lteceq.c ltecm.c lteqec.c ltp.c ltpb.c ltpecl.c ltpequ.c num00a.c num00b.c num06a.c numat.c nut00a.c nut00b.c nut06a.c nut80.c nutm80.c obl06.c obl80.c p06e.c p2pv.c p2s.c pap.c pas.c pb06.c pdp.c pfw06.c plan94.c pm.c pmat00.c pmat06.c pmat76.c pmp.c pmpx.c pmsafe.c pn.c pn00.c pn00a.c pn00b.c pn06.c pn06a.c pnm00a.c pnm00b.c pnm06a.c pnm80.c pom00.c ppp.c ppsp.c pr00.c prec76.c pv2p.c pv2s.c pvdpv.c pvm.c pvmpv.c pvppv.c pvstar.c pvtob.c pvu.c pvup.c pvxpv.c pxp.c refco.c rm2v.c rv2m.c rx.c rxp.c rxpv.c rxr.c ry.c rz.c s00.c s00a.c s00b.c s06.c s06a.c s2c.c s2p.c s2pv.c s2xpv.c sepp.c seps.c sp00.c starpm.c starpv.c sxp.c sxpv.c taitt.c taiut1.c taiutc.c tcbtdb.c tcgtt.c tdbtcb.c tdbtt.c tf2a.c tf2d.c tpors.c tporv.c tpsts.c tpstv.c tpxes.c tpxev.c tr.c trxp.c trxpv.c tttai.c tttcg.c tttdb.c ttut1.c t_sofa_c.c ut1tai.c ut1tt.c ut1utc.c utctai.c utcut1.c xy06.c xys00a.c xys00b.c xys06a.c zp.c zpv.c zr.c)
  
  add_library(sofa_c ${SOURCE_FILES})
  </code></pre>
  
  <p>After building the project I get a <code>libsofa_c.a</code> file as expected. </p>
  
  <p>Now I want to use this file in another project. 
  I generate a new project and add this line to the <code>.pro</code> file of the new project:</p>
  
  <pre><code>LIBS += ../IAU_SOFA/Release/libsofa_c.a
  </code></pre>
  
  <p><code>../IAU_SOFA/Release/</code> is the path where I copied the <code>libsofa_c.a</code> file. </p>
  
  <p>I then copied the header files to the new project and tried to include them. However, if I now try to build the application, no error message shows up and it seems as if the build succeeds. </p>
  
  <p>This is how my .pro file looks like:</p>
  
  <pre><code>QT       += core gui
  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  CONFIG += c++11
  DEFINES += QT_DEPRECATED_WARNINGS
  
  LIBS += ../IAU_SOFA/Release/libsofa_c.a # I added this line
  
  SOURCES += \
      main.cpp \
      mainwindow.cpp
  HEADERS += \
      mainwindow.h  \
      sofa.h \ # I added this line
      sofam.h # I added this line
  FORMS += \
      mainwindow.ui
  qnx: target.path = /tmp/$${TARGET}/bin
  else: unix:!android: target.path = /opt/$${TARGET}/bin
  !isEmpty(target.path): INSTALLS += target
  </code></pre>
  
  <p>However, if I try to run or debug the application via Qt Creator it simply does not show up. 
  All I get is the following lines of code: </p>
  
  <pre><code>14:41:27: Debuggen beginnt (debugging starts)
  t_sofa_c validation successful
  14:41:28: Debuggen beendet (debugging ends)
  </code></pre>
  
  <p>This is the full message of the compile output I get (sry it is partly in German. Most importantly, it says that the process finished normally in the last line) </p>
  
  <pre><code>14:45:17: Führe Schritte für Projekt test_sofa_qt aus...
  14:45:17: Starte: "D:\Qt\5.14.2\mingw73_64\bin\qmake.exe" D:\programmieren\test_sofa_qt\test_sofa_qt.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
  14:45:18: Der Prozess "D:\Qt\5.14.2\mingw73_64\bin\qmake.exe" wurde normal beendet.
  14:45:18: Starte: "D:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" -f D:/programmieren/build-test_sofa_qt-Desktop_Qt_5_14_2_MinGW_64_bit-Debug/Makefile qmake_all
  mingw32-make: Nothing to be done for 'qmake_all'.
  14:45:18: Der Prozess "D:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" wurde normal beendet.
  14:45:18: Starte: "D:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" -j8
  D:/Qt/Tools/mingw730_64/bin/mingw32-make -f Makefile.Debug
  mingw32-make[1]: Entering directory 'D:/programmieren/build-test_sofa_qt-Desktop_Qt_5_14_2_MinGW_64_bit-Debug'
  D:\Qt\5.14.2\mingw73_64\bin\uic.exe ..\test_sofa_qt\mainwindow.ui -o ui_mainwindow.h
  g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\test_sofa_qt -I. -I..\..\Qt\5.14.2\mingw73_64\include -I..\..\Qt\5.14.2\mingw73_64\include\QtWidgets -I..\..\Qt\5.14.2\mingw73_64\include\QtGui -I..\..\Qt\5.14.2\mingw73_64\include\QtANGLE -I..\..\Qt\5.14.2\mingw73_64\include\QtCore -Idebug -I. -I/include -I..\..\Qt\5.14.2\mingw73_64\mkspecs\win32-g++  -o debug\main.o ..\test_sofa_qt\main.cpp
  g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\test_sofa_qt -I. -I..\..\Qt\5.14.2\mingw73_64\include -I..\..\Qt\5.14.2\mingw73_64\include\QtWidgets -I..\..\Qt\5.14.2\mingw73_64\include\QtGui -I..\..\Qt\5.14.2\mingw73_64\include\QtANGLE -I..\..\Qt\5.14.2\mingw73_64\include\QtCore -Idebug -I. -I/include -I..\..\Qt\5.14.2\mingw73_64\mkspecs\win32-g++  -o debug\mainwindow.o ..\test_sofa_qt\mainwindow.cpp
  g++ -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -dM -E -o debug\moc_predefs.h ..\..\Qt\5.14.2\mingw73_64\mkspecs\features\data\dummy.cpp
  D:\Qt\5.14.2\mingw73_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include D:/programmieren/build-test_sofa_qt-Desktop_Qt_5_14_2_MinGW_64_bit-Debug/debug/moc_predefs.h -ID:/Qt/5.14.2/mingw73_64/mkspecs/win32-g++ -ID:/programmieren/test_sofa_qt -ID:/Qt/5.14.2/mingw73_64/include -ID:/Qt/5.14.2/mingw73_64/include/QtWidgets -ID:/Qt/5.14.2/mingw73_64/include/QtGui -ID:/Qt/5.14.2/mingw73_64/include/QtANGLE -ID:/Qt/5.14.2/mingw73_64/include/QtCore -I. -ID:/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/c++ -ID:/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/c++/x86_64-w64-mingw32 -ID:/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/c++/backward -ID:/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include -ID:/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include-fixed -ID:/Qt/Tools/mingw730_64/x86_64-w64-mingw32/include ..\test_sofa_qt\mainwindow.h -o debug\moc_mainwindow.cpp
  g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\test_sofa_qt -I. -I..\..\Qt\5.14.2\mingw73_64\include -I..\..\Qt\5.14.2\mingw73_64\include\QtWidgets -I..\..\Qt\5.14.2\mingw73_64\include\QtGui -I..\..\Qt\5.14.2\mingw73_64\include\QtANGLE -I..\..\Qt\5.14.2\mingw73_64\include\QtCore -Idebug -I. -I/include -I..\..\Qt\5.14.2\mingw73_64\mkspecs\win32-g++  -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp
  g++ -Wl,-subsystem,windows -mthreads -o debug\test_sofa_qt.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o  ..\IAU_SOFA\Release\libsofa_c.a D:\Qt\5.14.2\mingw73_64\lib\libQt5Widgets.a D:\Qt\5.14.2\mingw73_64\lib\libQt5Gui.a D:\Qt\5.14.2\mingw73_64\lib\libQt5Core.a  -lmingw32 D:\Qt\5.14.2\mingw73_64\lib\libqtmain.a -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.7.25-winx64\lib -LC:\Utils\postgresql\pgsql\lib -lshell32 
  mingw32-make[1]: Leaving directory 'D:/programmieren/build-test_sofa_qt-Desktop_Qt_5_14_2_MinGW_64_bit-Debug'
  14:45:23: Der Prozess "D:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" wurde normal beendet.
  14:45:23: Verstrichene Zeit: 00:06.
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>When building the library and the application I make sure to use the same kit in Qt Creator. </p>