Cross compiling woes

Hi,

I can’t seem to get the cross compiler set up properly. I can compile
the files to object files all right, but on linking I get undefined
references.

I tried using the cross compiler found here:
http://www.libsdl.org/Xmingw32/

… as well as the mingw32 Debian package. Either way, same results.

For example, if I try to compile the “checkkeys.c” test program, I get:

gcc sdl-config --cflags -c checkkeys.c
gcc sdl-config --libs -o checkkeys checkkeys.o
checkkeys.o(.text+0x77):checkkeys.c: undefined reference to SDL_GetModState' checkkeys.o(.text+0x24a):checkkeys.c: undefined reference toSDL_GetKeyName’
checkkeys.o(.text+0x3cf):checkkeys.c: undefined reference to SDL_SetVideoMode' checkkeys.o(.text+0x412):checkkeys.c: undefined reference toSDL_EnableUNICODE’
checkkeys.o(.text+0x424):checkkeys.c: undefined reference to SDL_EnableKeyRepeat' checkkeys.o(.text+0x444):checkkeys.c: undefined reference toSDL_WaitEvent’

Naturally, the gcc and sdl-config point to the cross-tools version.

Please CC to me, I’m not subscribed.

Thanks for your help!

// joey tsai-- 

joey tsai | MISFORTUNE, n. The kind of fortune that never misses.
| – Ambrose Bierce, “The Devil’s Dictionary”

I can’t seem to get the cross compiler set up properly. I can compile
the files to object files all right, but on linking I get undefined
references.

For example, if I try to compile the “checkkeys.c” test program, I get:

gcc sdl-config --cflags -c checkkeys.c
gcc sdl-config --libs -o checkkeys checkkeys.o

Move the sdl-config --libs to after the object files and it should work
fine, assuming you have the libraries available.On Mon, 14 Jan 2002, joey tsai wrote:

Mike.