Cannot find SDL.h when

I'm trying to use TTF for the games I want to develop, I'm fairly new to this so I would thank you a lot if you could answer a question for me:

After I followed the installation instructions correctly (at least I hope i did) I tried to compile my project including TTF, but I wasn't able, an error showed telling me that the compiler couldn't find "SDL.h", what shoul I do? I'm using codeblocks if that helps and this is my compiler line:

g++ -o bin/Debug/tuctactoe obj/Debug/game.o obj/Debug/main.o -lGL -lGLEW -lSDL2 -lSDL2_image -lSDL2_ttf -lSDL 

Hope you can answer my question.

Upvotes: 0

Views: 1199

Answers (1)

John Zwinck
John Zwinck

Reputation: 249642

It looks like you're missing the "dev" package for libsdl-ttf. On Ubuntu/Debian you can install it this way:

sudo apt-get install libsdl-ttf2.0-dev

On RHEL/CentOS/Fedora it might be this, but I'm not sure:

sudo yum install SDL-devel

You can quickly find out if SDL.h is anywhere on your machine by running:

locate SDL.h

If it is installed somewhere, you need to add that path using a -I rule to your compilation command, like this:

g++ -I/your/path/to/SDL.h # ...

Upvotes: 4

Related Questions