View Full Version : Setting path to compiler

April 15th, 2010, 02:11 PM
I just installed SDL on my ubuntu. I wrote simple program and saved it as num1.c.
Now when i want to compile it with g++ -o -L/usr/include/SDL/ num1.c it says that it cant read the SDL.h file.

So how to set the path to /usr/include/SDL/ and compile the program?

April 15th, 2010, 03:11 PM
include paths are set with -I
-L is for library paths
also your -o flag is missing a output filename

sdl has a config program which makes this easier
sdl-config --libs --cflags
prints all flags and libraries

g++ `sdl-config --libs --cflags` file.cpp