Linking programs with SDL (first time compiling with gcc)

First of all, thanks to everyone who has been giving me advice so far. Every new piece of information or way to use commands that I haven’t seen before is helping a lot.

ok. I’m now trying to compile using the following line: gcc sdl-config --cflags SDLtest.c sdl-config --static-libs

for me --static-libs sends the linker to the right files for all the X11 stuff that wasn’t showing up under just plain --libs. (This might not be the best way to resolve the problem with X11. if so let me know.)

NOW, gcc gives me a much smaller set of errors for its output:

/usr/lib/libSDL.a(SDL_fbevents.lo)(.text+0x942): In function find_pid': : undefined reference to__ctype_b’
/usr/lib/libSDL.a(SDL_fbelo.lo)(.text+0x465): In function eloSendQuery': : undefined reference to__ctype_toupper’
/usr/lib/libSDL.a(SDL_fbelo.lo)(.text+0x5f1): In function eloInitController': : undefined reference to__ctype_tolower’
collect2: ld returned 1 exit status

Now how should I go about resolving these? Thanks again for the help with this. Hopefully I’ll be asking much more interesting questions soon :slight_smile: -John---------------------------------
Do you Yahoo!?
Yahoo! Hotjobs: Enter the “Signing Bonus” Sweepstakes

First of all, thanks to everyone who has been giving me advice so far. Every new piece of information or way to use commands that I haven’t seen before is helping a lot.

ok. I’m now trying to compile using the following line: gcc sdl-config --cflags SDLtest.c sdl-config --static-libs

for me --static-libs sends the linker to the right files for all the X11 stuff that wasn’t showing up under just plain --libs. (This might not be the best way to resolve the problem with X11. if so let me know.)

NOW, gcc gives me a much smaller set of errors for its output:

/usr/lib/libSDL.a(SDL_fbevents.lo)(.text+0x942): In function find_pid': : undefined reference to__ctype_b’
/usr/lib/libSDL.a(SDL_fbelo.lo)(.text+0x465): In function eloSendQuery': : undefined reference to__ctype_toupper’
/usr/lib/libSDL.a(SDL_fbelo.lo)(.text+0x5f1): In function eloInitController': : undefined reference to__ctype_tolower’
collect2: ld returned 1 exit status

Now how should I go about resolving these? Thanks again for the help with this. Hopefully I’ll be asking much more interesting questions soon :slight_smile: -John----- Original Message -----
From: John Jung
To: sdl at libsdl.org
Sent: Thursday, January 08, 2004 11:04 AM
Subject: [SDL] linking programs with SDL (first time compiling with gcc)


Do you Yahoo!?
Yahoo! Hotjobs: Enter the “Signing Bonus” Sweepstakes

i guess try gcc->g++ may help.
g++ sdl-config --cflags SDLtest.c sdl-config --static-libs

John Jung wrote:

NOW, gcc gives me a much smaller set of errors for its output:

/usr/lib/libSDL.a(SDL_fbevents.lo)(.text+0x942): In function find_pid': : undefined reference to__ctype_b’
/usr/lib/libSDL.a(SDL_fbelo.lo)(.text+0x465): In function eloSendQuery': : undefined reference to__ctype_toupper’
/usr/lib/libSDL.a(SDL_fbelo.lo)(.text+0x5f1): In function eloInitController': : undefined reference to__ctype_tolower’
collect2: ld returned 1 exit status

Try including <ctype.h> and/or use nm to find the library which contains
these symbols. Maybe the package isn’t really compatible with
your (g)libc. In this case you probably have to compile SDL yourself.–
Christian
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040108/f3f6d13b/attachment.pgp