[SDL] compiling problems with SDL.h

Petri Latvala adrinael at nuclearzone.org
Sun Nov 30 05:29:01 PST 2003

> I have used:
> gcc -o myfirst myfirst.c `sdl-config --cflags` `sdl-config --libs` 
> and I have added export PATH=$PATH:/usr/local/bin 
> in /home/roberto/.bashrc
> Besides, I have finded other library SDL in my mpeg4ip project and I have renamed the file config.cache in config.cache-old in SDL directory ($ locate config.cache return /home/projects/SDL-1.2.6/config.cache)
> but compiler's answere is:
> sdl-config --cflags no such file or directory
> sdl-config --libs no such file or directory
> SDL.h no such file  or directory
> SDL_INIT_VIDEO undeclared
> SDL_INIT_AUDIO undeclared 
> How I compile my files?

You need backticks, `, not apostrophes, '. The apostrophes makes the
shell pass the whole string inside them as one command line parameter,
that is, making gcc believe it's a filename you want to compile. The
backticks makes the shell execute the command inside them and put the
output in the command line.

Petri Latvala

More information about the SDL mailing list