Jan 21, 2010

OpenGL: in MacOSX

1. To get Started with XCode insert your OS X DVD.
2. install the XCode Tools found on the Leopard DVD under
Optional Installs->Xcode Tools
3. Open a terminal
4. #include instead of for compiling in MacOSX in the file.
5. gcc -Wall -o test test.c -framework OPENGL -framework GLUT

Problems:
--------------
1. If you run ./test and get the following error
GLUT Fatal Error: internal error: NSInternalInconsistencyException, reason: Error (1002) creating CGSWindow

Add the following line at the beginning of the main function
glutInit(&argc, argv);
Reference 1

Further reference for the problem.Reference 2

This post is build on the post.
Reference 3

Run an OpenGL code in MacOSX using XCode. Reference 4


Other useful resource:
1. Alfonse Tutorial 
2. Useful resource suggestions

1 comment:

Unknown said...

Thanks for the tip. Saved me!
-C

Carlo Cipolla's Laws of Stupidity

    "By creating a graph of Cipolla's two factors, we obtain four groups of people. Helpless people contribute to society but are...