Cross Compiling

Ok the source I have compiles fine for linux. I made the cross compiler
too and that works fine for creating executables, so far. The problem I am
having is linking libraries to my code. I’m trying to compile an SDL
application by changing the compiler and linker in the Makefile to point
to the new cross compiler. When I do that I get the error

…/…/…/cross-tools/bin/i386-mingw32msvc-ld: cannot find -lSDL
make: *** [battlesim] Error 1

Do I need to get the windows .dll version of SDL and link to that or
something?

http://www.mongeese.org

I got my code to compile easily for Linux and Win32 by using the
autoconf/automake setup like SDL and many libraries use. I started with the
config files for the SDL tests and went from there. To compile for Linux,
you use the normal “./configure; make”, and for Win32, use the scripts that
are on the Xmingw32 “./cross-configure.sh; ./cross-make.sh”. It can be
helpful to write some shell scripts to automate building for each platform,
to do things that autoconf can’t do for you (like putting a .exe extension
on the Win32 executable).> Ok the source I have compiles fine for linux. I made the cross compiler

too and that works fine for creating executables, so far. The problem I am
having is linking libraries to my code. I’m trying to compile an SDL
application by changing the compiler and linker in the Makefile to point
to the new cross compiler. When I do that I get the error

…/…/…/cross-tools/bin/i386-mingw32msvc-ld: cannot find -lSDL
make: *** [battlesim] Error 1

Do I need to get the windows .dll version of SDL and link to that or
something?

Where are these cross-configure, cross-make files? I don’t see them
with Xmingw32. But more importantly is how to get the program to link
correctly against a windows .dll.

http://www.mongeese.orgOn Wed, 7 Feb 2001, David Phillips wrote:

I got my code to compile easily for Linux and Win32 by using the
autoconf/automake setup like SDL and many libraries use. I started with the
config files for the SDL tests and went from there. To compile for Linux,
you use the normal “./configure; make”, and for Win32, use the scripts that
are on the Xmingw32 “./cross-configure.sh; ./cross-make.sh”. It can be
helpful to write some shell scripts to automate building for each platform,
to do things that autoconf can’t do for you (like putting a .exe extension
on the Win32 executable).

Ok the source I have compiles fine for linux. I made the cross compiler
too and that works fine for creating executables, so far. The problem I am
having is linking libraries to my code. I’m trying to compile an SDL
application by changing the compiler and linker in the Makefile to point
to the new cross compiler. When I do that I get the error

…/…/…/cross-tools/bin/i386-mingw32msvc-ld: cannot find -lSDL
make: *** [battlesim] Error 1

Do I need to get the windows .dll version of SDL and link to that or
something?

http://www.libsdl.org/Xmingw32/

If you go to the link under “Instructions by Ray Kelm for building a cross
compiler” and download and run the cross.sh script, then you should be able
to have everything for Win32 compile and link correctly by specifying the
correct target and using the cross-tools by simply running the
cross-configure.sh and cross-make.sh scripts (assuming the autoconf/automake
scripts are setup for that, as is SDL and several of the libraries, like
SDL_image).> Where are these cross-configure, cross-make files? I don’t see them

with Xmingw32. But more importantly is how to get the program to link
correctly against a windows .dll.