Linkerproblem mit MXE

Pik-9

Pik-9

Tripel-As
Hallo Leute :winke:,

ich war echt lange nicht mehr hier...
Wie auch immer, ich schreibe gerade ein Programm, das sowohl Qt5, als auch OpenMP benutzt (Wer den Code sehen will: https://github.com/Pik-9/PokerTH-Tracker) und unter Linux funktioniert alles hervorragend, doch wenn ich es mit MXE für Windows cross kompilieren will, kriege ich einige Linker Fehler:
Code:
/opt/mxe/usr/i686-w64-mingw32.static/lib/libpthread.a(libwinpthread_la-thread.o): In function `pthread_cancel':
/opt/mxe/tmp-gcc-i686-w64-mingw32.static/gcc-4.9.3/mingw-w64-v4.0.6/mingw-w64-libraries/winpthreads/src/thread.c:1078: multiple definition of `pthread_cancel'
/opt/mxe/usr/i686-w64-mingw32.static/lib/libmysqlclient.a(my_winthread.c.obj):/opt/mxe/tmp-libmysqlclient-i686-w64-mingw32.static/mysql-connector-c-6.1.6-src/mysys/my_winthread.c:247: first defined here
/opt/mxe/usr/i686-w64-mingw32.static/lib/libpthread.a(libwinpthread_la-thread.o): In function `pthread_attr_init':
/opt/mxe/tmp-gcc-i686-w64-mingw32.static/gcc-4.9.3/mingw-w64-v4.0.6/mingw-w64-libraries/winpthreads/src/thread.c:1215: multiple definition of `pthread_attr_init'
/opt/mxe/usr/i686-w64-mingw32.static/lib/libmysqlclient.a(my_winthread.c.obj):/opt/mxe/tmp-libmysqlclient-i686-w64-mingw32.static/mysql-connector-c-6.1.6-src/mysys/my_winthread.c:25: first defined here
/opt/mxe/usr/i686-w64-mingw32.static/lib/libpthread.a(libwinpthread_la-thread.o): In function `pthread_attr_destroy':
/opt/mxe/tmp-gcc-i686-w64-mingw32.static/gcc-4.9.3/mingw-w64-v4.0.6/mingw-w64-libraries/winpthreads/src/thread.c:1225: multiple definition of `pthread_attr_destroy'
/opt/mxe/usr/i686-w64-mingw32.static/lib/libmysqlclient.a(my_winthread.c.obj):/opt/mxe/tmp-libmysqlclient-i686-w64-mingw32.static/mysql-connector-c-6.1.6-src/mysys/my_winthread.c:47: first defined here
/opt/mxe/usr/i686-w64-mingw32.static/lib/libpthread.a(libwinpthread_la-thread.o): In function `pthread_attr_getstacksize':
/opt/mxe/tmp-gcc-i686-w64-mingw32.static/gcc-4.9.3/mingw-w64-v4.0.6/mingw-w64-libraries/winpthreads/src/thread.c:1289: multiple definition of `pthread_attr_getstacksize'
/opt/mxe/usr/i686-w64-mingw32.static/lib/libmysqlclient.a(my_winthread.c.obj):/opt/mxe/tmp-libmysqlclient-i686-w64-mingw32.static/mysql-connector-c-6.1.6-src/mysys/my_winthread.c:41: first defined here
/opt/mxe/usr/i686-w64-mingw32.static/lib/libpthread.a(libwinpthread_la-thread.o): In function `pthread_attr_setstacksize':
/opt/mxe/tmp-gcc-i686-w64-mingw32.static/gcc-4.9.3/mingw-w64-v4.0.6/mingw-w64-libraries/winpthreads/src/thread.c:1296: multiple definition of `pthread_attr_setstacksize'
/opt/mxe/usr/i686-w64-mingw32.static/lib/libmysqlclient.a(my_winthread.c.obj):/opt/mxe/tmp-libmysqlclient-i686-w64-mingw32.static/mysql-connector-c-6.1.6-src/mysys/my_winthread.c:34: first defined here
/opt/mxe/usr/i686-w64-mingw32.static/lib/libpthread.a(libwinpthread_la-thread.o): In function `pthread_create':
/opt/mxe/tmp-gcc-i686-w64-mingw32.static/gcc-4.9.3/mingw-w64-v4.0.6/mingw-w64-libraries/winpthreads/src/thread.c:1426: multiple definition of `pthread_create'
/opt/mxe/usr/i686-w64-mingw32.static/lib/libmysqlclient.a(my_winthread.c.obj):/opt/mxe/tmp-libmysqlclient-i686-w64-mingw32.static/mysql-connector-c-6.1.6-src/mysys/my_winthread.c:140: first defined here
/opt/mxe/usr/i686-w64-mingw32.static/lib/libpthread.a(libwinpthread_la-thread.o): In function `pthread_join':
/opt/mxe/tmp-gcc-i686-w64-mingw32.static/gcc-4.9.3/mingw-w64-v4.0.6/mingw-w64-libraries/winpthreads/src/thread.c:1533: multiple definition of `pthread_join'
/opt/mxe/usr/i686-w64-mingw32.static/lib/libmysqlclient.a(my_winthread.c.obj):/opt/mxe/tmp-libmysqlclient-i686-w64-mingw32.static/mysql-connector-c-6.1.6-src/mysys/my_winthread.c:237: first defined here

Das Problem ist eigentlich klar: Beide Bibliotheken sind statisch gegen pthread gelinkt (MXE linkt alles statisch) und deswegen ist der Linker verwirrt, da die Symbole doppelt vorkommen. Bevor ich OpenMP mit ins Boot geholt hatte, traten diese Fehler auch nicht auf und ich kann es kompilieren, wenn ich OpenMP deaktiviere (so wie in der QMake pro Datei), aber schöner wäre es, wenn es irgendwie mit OpenMP ginge...
Nur leider habe ich keine Idee, wie ich das beheben oder umgehen kann! :think:
Alle Beiträge, die ich im Internet dazu finden konnte, besagten, dass man die Bibliotheken selbst anders erstellen sollte, aber das ist in meinem Fall leider nicht wirklich eine Option.

Hat einer von euch vielleicht eine Idee?

Vielen Dank und viele Grüße,
Pik-9
 

Ähnliche Themen

Linker meckert über nicht definierte Funktion

JBidWatcher: Problem bei loading Auctions in Verbindung mit mySQL

dovecot und postfix Konfiguration Problem

Samba 4 Gast Zugang unter Ubuntu funktioniert nicht

multiple definition SystemC

Zurück
Oben