Monday, January 11, 2010

SDL on Apple Mac OS X


Short post on using SDL on Mac OS X:
  1. Download SDL - the source tarball.
  2. Extract the tar, and open the command prompt to that directory
  3. Type "./configure" "make" and "sudo make install".

    You should have the libSDL.a in /usr/local/lib, and headers in /usr/local/include/SDL
  4. Download/write a simple SDL test program, I like Sol's SDL tutorials, the nice old school plasma.
  5. Compile:
    g++ main.cpp -lsdl -lsdlmain -framework Cocoa -o output
    If you are using OpenGL, add a "-framework OpenGL" in the command line as well. (You can get a sample OpenGL SDL C++ program for OS X here).
And thats it!

1 comment:

mahasiswa teladan said...

hi...Im student from Informatics engineering nice article,
thanks for sharing :)