Patrick’s development blog

Compile SDL/OpenGL applications using g++

Posted in SDL / OpenGL by Patrick on February 16, 2009

This is how I compile a C++ program with SDL and the OpenGL libraries GL and GLU.

g++ -o appname opengl.cpp `sdl-config –libs –cflags` -lGL -lGLU

sdl-config –libs –cflags is used to get the library path and include path for SDL. This can be used instead of manually specifying the libraries for SDL.