Success! cross-compiling

Well, I finally got my game cross-compiled and running on a windoze box.
[Ugh… it was quite a learning process too…]

I’ve created the following DLL’s using the mingw32 cross-compiler under
linux(x86): (yes, the ones that I happened to need)

imglib.dll (imglib, soon to be named libSDLimg)
png.dll (png 1.0.3)
sdlnet.dll (libSDLnet)
sdlttf.dll (ttflib, soon to be named libSDLttf)
ttf.dll (freetype 1.2)
z.dll (zlib 1.1.3)

Here is the URL:
http://www.slothmud.org/~hayward/SDL

dlls_and_defs.tgz
[ This file also includes the def’s I created by hand for each package,
[ This is used when creating a dll under mingw32. I found a great page
[ that describes creating dll’s:
[ http://www.geocities.com/Tokyo/Towers/6162/win32/dll/make.html

mingw32_libs.tgz
[ (put them in /usr/local/cross-tools/i386-mingw32/lib)
[ This file includes the “.a” files for the following libs:
[ zlib 1.1.3, libSDLttf, libSDLnet, libSDLimg, libpng 1.0.3

mingw32_includes.tgz
[ (put them in /usr/local/cross-tools/i386-mingw32/include)
[ This file has the header files for the following libs:
[ zlib 1.1.3, libSDLttf, libSDLnet, libSDLimg, libpng 1.0.3

mingw32_freetype.tgz
[ untar this to: /usr/local/cross-tools/i386-mingw32
[ For linking: -L/usr/local/cross-tools/i386-mingw32/freetype/lib
[ For compiling: -I/usr/local/cross-tools/i386-mingw32/freetype/include

good luck!

I’m working on a cross-compiling FAQ as well. Thats enough for tonight,
I’m tired… :)–
Brian

P.S. Sam, feel free to mirror these on your site, or put a link up on
your mingw32 page.

Congratulations getting a cross-compiler working; the first time is always
tough!

Have you checked out the mingw32 FAQ?
(http://members.aol.com/lauram3017/mingw32.html) Your source for the DLL
information seems a bit dated since it doesn’t mention dllwrap.

The process of building a DLL is getting easier with each mingw32 release;
using dllwrap it’s a one-liner now… e.g. to build foo.dll from foo1.o and
foo2.o, and link with libbar.a, try this (all one line):

i386-mingw32-dllwrap -o foo.dll --dllname foo.dll --def foo.def
–driver-name i386-mingw32-gcc --dlltool i386-mingw32-dlltool
–as i386-mingw32-as foo1.o foo2.o -lbar

Also, for libraries ported from UNIX-like systems it is probably unnecessary
to create a .def file, since by convention UNIX libraries export all symbols
not declared static. You can tell dllwrap to use the UNIX behavior by
adding --export-all to the above command, and removing the --def part.

(As far as generating import libraries from foreign DLL’s, using a tool like
impdef.exe is currently the accepted method, although gcc will eventually
gain the ability to link directly with Win32 DLL’s.)

Please accept my apologies for boring you if this stuff is old hat…

Dan

wrote in message
news:85s18f$9rq$1 at news.lokigames.com…>

Well, I finally got my game cross-compiled and running on a windoze box.
[Ugh… it was quite a learning process too…]

I’ve created the following DLL’s using the mingw32 cross-compiler under
linux(x86): (yes, the ones that I happened to need)