Cross compiling IMGlib, SDLnet, ttflib

Hello everyone,

Sorry to keep spamming this list with my lack of cross-compiling
experience… I’m building a FAQ with all of this info as I go, so it
should keep this off of the list in the future! :slight_smile:

I have a working cross-compiler, but my program also need the demos:
IMGlib, SDLnet, and ttflib

Unfortunately, they don’t seem to be setup to configure smoothly under the
provided cross-compiler + sdl.

I am starting with IMGlib:
I downloaded the following files from the Xmingw32/SDL page:

I put the .h’s in /usr/local/cross-tools/i386-mingw32/include
and the .a’s in /usr/local/cross-tools/i386-mingw32/lib

The following points fail in configure for IMGlib:

  1. Fails to find: “libpng” and "libz"
    20 Fails to determine host
    (this is fixed by giving --host=i586-pc-linux-gnu to configure)–
    So looking at configure, I found that for PNG it just adds -DLOAD_PNG to
    CFLAGS, and -lz -lpng to LIBS. So I manually added them to the
    configure generated makefile.

I then did a make, make install, and it compiled with the i386-mingw32
compiler just fine and installed these files:

Into lib:

And into include:

Note, running ‘file’ on any of the ".o’s results in:
IMG.o: 80386 COFF executable not stripped - version 30821

Running ‘file’ on Sam’s provided SDL.dll results in:
SDL.dll: MS Windows PE 32-bit Intel 80386 GUI DLL

Is this a normal difference? I expected to see Windows somewhere in the
file output for the cross-compiled IMG.o.

This should be enough to link my program against IMGlib,
but I’d still need a “.dll” to place with my program on the windows
side to run it.

If someone can explain how to create the .dll or point me to the right
FAQ, I’d appreciate it. I thought this would be similar to creating a
".so", but unfortunately it doesn’t seem to work with the cross-compiler:

gcc -shared *.lo -o IMG.dll
gcc: unrecognized option `-shared’
file format not recognized; treating as linker script
parse error

Can this be done under linux/mingw32?

Brian Hayward