Hello
I have an application developed under Linux. It is running under W7 (mingw/Qt), but in order to distribute it to some
interested parties I want to make a distribution with (most of the) libs statically linked.
In order to do so, I installed under fedora-17 the mingw64 cross compilation set, including the static libs for Qt.
When building a non-statically bound version, it compiles completely to an executable.
When adding the QMAKE_LFLAGS += -static to the ".pro" file, compilation starts complaining about
some references from the libs not being resolved. Most likely they are windows references, but I have no clue
what libs to add.
This is the result of the link phase
x86_64-w64-mingw32-g++ -static -Wl,-s -Wl,-subsystem,console -mthreads -o release/spectrum-viewer.exe object_script.spectrum-viewer.Release -L'/usr/x86_64-w64-mingw32/sys-root/mingw/lib' /home/jan/cross-compiling/dll_64/libfftw3-3.lib /home/jan/cross-compiling/qwt-5.2.2/lib/libqwt.a -L c:\mingw\lib -lole32 -lwinmm -lstdc++ -lusb-1.0 -lQtGui4 -lQtCore4
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/libQtGui4.a(qapplication.o).text+0x1824): undefined reference to `__imp_CoCreateGuid'
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/libQtGui4.a(qapplication.o).text+0x1849): undefined reference to `__imp_StringFromGUID2'
/usr/lib64/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld: /usr/x86_64-w64-mingw32/sys-root/mingw/lib/libQtGui4.a(qapplication.o): bad reloc address 0x0 in section `.data'
/usr/lib64/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld: final link failed: Invalid operation
Note that when I add " -lole32 -lwinmm" at the end of the link line, these specific references seem to be resolved, however, some other appear.
Any help is greatly appreciated
jan
Bookmarks