PDA

View Full Version : SDL and TTF using g++


MoxJet
August 8th, 2006, 01:47 PM
Hello.

I have two questions.

First, is there a sudo apt-get install command for the SDL_TTF library?

Second, how would I write in the terminal to compile with SDL_TTF? Currently I use
g++ -o binary code.cpp -lSDL

Thanks in advance,
Dan

Randomskk
August 8th, 2006, 03:41 PM
For SDL TTF, you can apt-get install:
libsdl-ttf2.0-0
libsdl-ttf2.0-0-dev

or
libsdl-ttf1.2
libsdl-ttf1.2-dev

depends what version you want.
That way of linking looks fine, not sure if you also need to add -lSDL_TTF

By the way, I found those packages by using this command:
apt-cache search SDL TTF

hod139
August 8th, 2006, 05:28 PM
Second, how would I write in the terminal to compile with SDL_TTF? Currently I use
g++ -o binary code.cpp -lSDL


Use
g++ -o binary code.cpp `sdl-config --cflags --libs`-lSDL_ttf