Ich habe ein Tool erstellt, welches ich nun statisch kompilieren muss, um es auch auf Rechnern lauffähig zu bekommen, welche weder Qt- noch sonstige DLLs von Entwicklungsumgebungen (msvcrt.dll, ...), auf der Platte haben. Die DLLs sollen nicht mitgeliefert werden, da das Programm ohne Installation und ohne Kopieren einer großen Anzahl von Dateien laufen soll.
Nun habe ich sowohl im VS2003 als auch mal manuell über editieren des Makefiles, versucht, statisch zu kompilieren. Da es sich bei der Anwendung um ein Tool mit Multithreading handelt, habe ich folgende Einstellungen gewählt:
- Release-Mode
- RunTime-Library ist Multithreaded (/MT) ohne DLL
- der Linker ignoriert die Bibliotheken libc.lib und msvcrt.lib, da diese sonst mit den Multithreaded-Libraries im Konflikt stehen.
Nun erhalte ich massig Meldungen vom Linker - sowohl Warnungen als auch Fehler. Hier ein Auszug:
Code: Alles auswählen
[...]
qt-mt.lib(qfile_win.obj) : warning LNK4217: Lokal definiertes Symbol __errno, importiert in Funktion "public: virtual void __thiscall QFile::close(void)" (?close@QFile@@UAEXXZ)
qt-mt.lib(qtextstream.obj) : warning LNK4217: Lokal definiertes Symbol _isxdigit, importiert in Funktion "private: unsigned long __thiscall QTextStream::input_hex(void)" (?input_hex@QTextStream@@AAEKXZ)
qt-mt.lib(pngread.obj) : warning LNK4217: Lokal definiertes Symbol _abort, importiert in Funktion _png_create_read_struct_2
qt-mt.lib(pngwrite.obj) : warning LNK4217: Lokal definiertes Symbol _abort, importiert in Funktion _png_write_info_before_PLTE
qt-mt.lib(qobject.obj) : error LNK2019: Nicht aufgelöstes externes Symbol '__imp__strstr', verwiesen in Funktion '"void __cdecl err_info_about_candidates(int,class QMetaObject const *,char const *,char const *)" (?err_info_about_candidates@@YAXHPBVQMetaObject@@PBD1@Z)'
qt-mt.lib(qconnection.obj) : error LNK2001: Nichtaufgelöstes externes Symbol __imp__strstr
qt-mt.lib(qimage.obj) : error LNK2001: Nichtaufgelöstes externes Symbol __imp__strstr
qt-mt.lib(qthread_win.obj) : error LNK2019: Nicht aufgelöstes externes Symbol '__imp___endthreadex', verwiesen in Funktion '"public: static void __cdecl QThread::exit(void)" (?exit@QThread@@SAXXZ)'
qt-mt.lib(qthread_win.obj) : error LNK2019: Nicht aufgelöstes externes Symbol '__imp___beginthreadex', verwiesen in Funktion '"public: void __thiscall QThread::start(enum QThread::Priority)" (?start@QThread@@QAEXW4Priority@1@@Z)'
qt-mt.lib(qapplication_win.obj) : error LNK2019: Nicht aufgelöstes externes Symbol '__imp__strrchr', verwiesen in Funktion '"void __cdecl set_winapp_name(void)" (?set_winapp_name@@YAXXZ)'
qt-mt.lib(qapplication_win.obj) : error LNK2019: Nicht aufgelöstes externes Symbol '__imp__toupper', verwiesen in Funktion '"int __cdecl asciiToKeycode(char,int)" (?asciiToKeycode@@YAHDH@Z)'
qt-mt.lib(qcstring.obj) : error LNK2001: Nichtaufgelöstes externes Symbol __imp__toupper
qt-mt.lib(qfileinfo_win.obj) : error LNK2001: Nichtaufgelöstes externes Symbol __imp__toupper
qt-mt.lib(qimage.obj) : error LNK2001: Nichtaufgelöstes externes Symbol __imp__toupper
[...]Vielen Dank schonmal im Voraus!
Viele Grüße
JOHANNES