PDA

View Full Version : [SOLVED] Mingw32 on Linux - ld error



huilui
27th August 2013, 01:41
Hi guys,

I'm currently trying to compile a small Qt app on Linux for Windows.
I'm running ArchLinux and installed a static mingw32-qt4. I ran into a few problems, but most of them I solved via searching the web and/or this forum here. I have the following options (beside the normal stuff) set in my pro-file:

QMAKE_CXX = /usr/bin/i486-mingw32-g++

QMAKE_INCDIR = /usr/i486-mingw32/include
QMAKE_INCDIR_QT = /usr/i486-mingw32/include/qt4
QMAKE_LIBDIR_QT = /usr/i486-mingw32/lib/qt4/

QMAKE_MOC = /usr/i486-mingw32/lib/qt4/bin/moc

Running i486-mingw32-qmake produces the right Makefile, and the following make also runs smoothly - well, almost. Right at the end, it gives me the following error:

/usr/lib/gcc/i486-mingw32/4.7.2/../../../../i486-mingw32/bin/ld: cannot find -lQtGui
/usr/lib/gcc/i486-mingw32/4.7.2/../../../../i486-mingw32/bin/ld: cannot find -lQtCore


Is it possible to tell ld where to look for the include files? I already had to add the couple lines to the pro-file to tell make where to look, is there something similar for ld? So far, I haven't found way to do this (or what else to do)...

Many thanks for every hint and tip!

huilui


Edit:
I also tried adding to the pro-file:

QMAKE_LIBDIR += /usr/i486-mingw32/lib/qt4/
but that didn't do anything either...

Added after 38 minutes:

Okay, I was close: Adding

QMAKE_LIBDIR += /usr/i486-mingw32/lib/
does the trick. It now compiles on Linux and runs perfectly on Windows.