Re: crosscompiling on linux for windows, link failure



On Mon, 10 Jan 2005, Dave Andruczyk wrote:

I've had problems since day one linking my appplication (native linux, GTK+-2.x based) for windows when crosscompiling it.

The main errors seem to stem from libtool:

Everything compiles fine, except the final linking operation
/bin/sh ../libtool --mode=link i386-mingw32msvc-gcc -mms-bitfields
-I/target/inc
lude/hacks  -Wall  -O2  -L/opt/cross-tools/i386-mingw32msvc/lib -o
megatunix.exe  3d_vetable.o about_gui.o ... (and so on)

I'm not sure precisely where the error is, but that is a truly weird link command line.

1. This may be an artifact of the way you posted, but there is a line break between "-I/target/inc" and "lude/hacks". (That in itself would be enough to produce havoc.)

2. Be that as it may, there is no logic in having any "-I" flags in a linker command, since no headers are in question.

3. "/bin/sh ../libtool" is an odd invocation, since libtool starts with its own "# /bin/sh" line. One would expect simply "../libtool".

4. The "-L/dirfoo" lines should normally all follow the invocation of all the object files that will be linked into the executable.

In short, I'd recommend that you compare your Makefile (or Makefile.in, or Makefile.am, as appropriate) with "known good" examples of the genre.

Allin Cottrell




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]