[SDL] Problem compiling code with SDL_ttf
Alejandro Santos
alejandrosantos at fibertel.com.ar
Thu May 15 17:32:03 PDT 2003
Ryan: Looks like you are not linking your program with the SDL_ttf library.
Try adding the parameter -lSDL_ttf to the compiler, after the -lSDL
parameter. Something like this may work:
gcc
fontbuilder.c -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lSDL_ttf -I/us
r/include/SDL -D_REENTRANT
Alejandro.
----- Original Message -----
From: "Ryan Hanlon" <ryanh at uidaho.edu>
To: <sdl at libsdl.org>
Sent: Thursday, May 15, 2003 8:16 PM
Subject: [SDL] Problem compiling code with SDL_ttf
> Any ideas on this will be very helpful. I'm having problems compiling
> anything to use SDL_ttf. I've tried the same things on Red Hat 7.3 and
> 8.0 machines, both with the same set of SDL packages installed: I have
> SDL 1.2.5, SDL_ttf 2.0.6, FreeType 2.1.2, and all the matching 'devel'
> packages (all installed from rpms) on both machines. But when I try to
> compile anything that uses the TTF functions, I get linker errors. For
> example, compiling Patrick Kooman's Sfont/Bfont utility
> (http://www.2dgame-tutorial.com/sdl/fontbuilder/fontbuilder.c) with the
> compiler flags and libs from `sdl-config`, gives this:
>
>
> gcc
fontbuilder.c -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -I/usr/include/
SDL -D_REENTRANT
> /tmp/cc5BwFjo.o: In function `CreateFontSurface':
> /tmp/cc5BwFjo.o(.text+0x75): undefined reference to `TTF_Init'
> /tmp/cc5BwFjo.o(.text+0xb8): undefined reference to `TTF_OpenFont'
> /tmp/cc5BwFjo.o(.text+0x109): undefined reference to `TTF_SetFontStyle'
> /tmp/cc5BwFjo.o(.text+0x16a): undefined reference to
`TTF_RenderText_Shaded'
> /tmp/cc5BwFjo.o(.text+0x1d7): undefined reference to `TTF_CloseFont'
> /tmp/cc5BwFjo.o(.text+0x1df): undefined reference to `TTF_Quit'
> /tmp/cc5BwFjo.o(.text+0x228): undefined reference to `TTF_CloseFont'
> /tmp/cc5BwFjo.o(.text+0x230): undefined reference to `TTF_Quit'
> collect2: ld returned 1 exit status
>
> I have run 'ldconfig' a few times since those packages were installed on
> each machine, so I don't think that's a problem. What libraries would
> those functions require that wouldn't come with SDL and SDL_ttf, and how
> would I go about getting/updating them?
>
>
> Thanks,
> Ryan
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>
More information about the SDL
mailing list