PDA

View Full Version : Problems compiling SDL programs



bloodroses75
March 22nd, 2005, 05:47 AM
Hello, im a relatively new convert from gentoo linux to ubuntu linux and I am having a problem compiling a SDL game I've been working on since using gentoo. I have not modified the code yet since working w/ gentoo and the program compiled fine on it. However, when i now try to compile it under ubuntu i get this error during compile:


sunfire:/home/stuff/shooter $ ./compbatch
./compbatch: line 1: sdl-config: command not found
testshoot.c:1:21: SDL/SDL.h: No such file or directory
In file included from testshoot.c:8:
soundsys.h:4:21: SDL/SDL.h: No such file or directory


here is the script for compbatch:

gcc testshoot.c soundsys.c imgmanip.c -o testshoot `sdl-config --libs --cflags` -lSDL_image -lSDL_ttf

i am using g++ for the compiler and i have checked through apt-get and it claims libsdl is installed along w/ g++. Does anyone have any suggestions to fix this?

Thank you in advance.

toojays
March 22nd, 2005, 09:52 AM
Welcome. I also migrated from Gentoo a couple of months ago, so I know where you're coming from. On Ubuntu, to get the headers for a library, you need to install the corresponding -dev package. For SDL, this is libsdl1.2-dev.

bloodroses75
March 22nd, 2005, 10:05 PM
apt-get'd libsdl1.2-dev, libsdl-image1.2-dev, and libsdl-ttf2.0-dev and now my program compiles fine now. :mrgreen:

thank you for the help