Building OpenGL/GLUT Programs on Mac OS X with Older Xcode
For the full instructions on how to build OpenGL/GLUT programs on Mac OS X, including instructions for newer version of Xcode, see
Building OpenGL/GLUT Programs.
Please let me know if you
have any correction or addition. Thanks.
Graphical step-by-step for:
Xcode 3.2.4: "Application→Command Line Tool".
For the sample code, select project type "C" and click
"Choose" (Fig. 18bis3)
Xcode 3.1.2: "Command Line Utility→C++ Tool" and
click "Choose" (Fig. 18bis2)
Xcode 2: "Command Line Utility→C++ Tool" and
click "Next" (Fig. 18bis)
Give the project a name, e.g., "sampleapp" and click "Save" (Fig. 19bis2)
[Xcode 2: click "Finish" (Fig. 19bis)]
Right click on file "main.cpp" to Delete it (Fig. 20)
Add source files:
Right click on "sampleapp" at the top of the "Groups & Files" pane on the left to
"Add→Existing Files" (Fig. 21bis),
select your file, for example, the provided sample.c,
and click "Add" (twice)
Add libraries:
Right click on "sampleapp" again to "Add→Existing Frameworks" (Fig. 22bis)
[Xcode 3.1.2: double click on the "Frameworks" folder (Fig. 23bis)]
select OpenGL.framework and click "Add"
(Fig. 24bis) [Xcode3.1.2: twice]
Repeat the previous step to add GLUT.framework
(Fig. 25bis)