The correct way is to add `sdl-config --cflags`
to your CXXFLAGS. (You should also add `sdl-config --libs`
to your LIBS, even if this does not seem appropriate to you in your case.)
To paraphrase the link: use the output of the sdl-config --cflags --libs
for SDL 1.2 or sdl2-config --cflags --libs
for SDL2, for example:
gcc -o test test.c `sdl-config --cflags --libs`
Fabel source share