Creating C & C++ OpenGL/GLUT Projects
- 1. Open Xcode
- Finder : MacIntosh HD : Developer : Applications : Xcode.app
- 2. Create a new Xcode project
- Xcode : File : New Project
- Command Line Utility : Standard Tool : Choose
- Select a name and location for your project : Save
- 3. Add the GLUT and OpenGL frameworks to your project. To make a 3-D project, also add the Cocoa framework.
- Control-click on the top-level project folder : Add : Existing Frameworks
- Choose GLUT and OpenGL frameworks (and Cocoa for 3D projects) : Add
- Command-click to select multiple nonadjacent frameworks or add each individually
- The defaults are fine on the Xcode configuration window : Add
- The frameworks are now included in your project
- You will need to #include <GLUT/glut.h> to use the GLUT libraries in Xcode as it is a unix system
- You would need to #include <GL\glut.h> to use the GLUT libraries on a windows system
- 4. Begin your project
- To add a file to the project, Control-click on the folder you wish to add the file to
- Add : New File
- In the next window Choose your file type : Next
- Name your file. If you do not want to create a .h file with the same name, uncheck the ' Also create �filename.h� ' check box : Finish
- Click on the name of the file you wish to edit and begin programming
- Notice that Xcode automatically creates a main.c for your project. Since Xcode automatically creates a main.c, if you add a file that contains a main(), you will get a compile time duplicate symbol error
- Clicking on the red circle with the white X at the bottom right of the Xcode project window, brings up the build results window listing the error(s)
- To remove the main.c file created by Xcode from your project:
- Control-click on the file : Delete : Also Move to Trash
Creating C OpenGL/Glut 3D Projects
Instructions are here
References
StanfordNorthwestern
One Sad Cookie
VIS
















