Building OpenGL/GLUT Programs on Linux with Older Eclipse
For the full instructions on how to build OpenGL/GLUT programs on Linux, including instructions for newer version of Eclipse, see
Building OpenGL/GLUT Programs.
Please let me know if you
have any correction or addition. Thanks.
Eclipse 3.2.0 project (graphical step-by-step):
Start up Eclipse and choose your workspace, click "OK" (Fig. 1)
Choose a wizard for your new project:
"C++→Managed Make C++ Project" (Fig. 3)
Give the project a name, e.g., "sampleapp",
click "Next >" (Fig. 4)
On the "Select a type of project" page,
accept "Project Type: Executable (Gnu)"
by clicking "Finish" (Fig. 5)
If prompted to "Open Associated Perspective?",
click "Yes" (Fig. 6)
Add libraries:
Right click on "sampleapp" on the first line of the "C/C++" pane on the left and
select "Properties" to tell the linker which libraries need to be added (Fig. 7)
On the "Properties for sampleapp" page,
click "C/C++ Build→GCC C++ Linker→Libraries" and
click on the "Libraries (-l) Add" button (Fig. 8)
Repeat the above two steps to add "GLU" and "glut" libraries
then click "Apply" and "OK" (Fig. 10)
Add source files:
Right click on "sampleapp" again and select "Import" (Fig. 11)
On the "Select" page, choose "General→File System" and click "Next >" (Fig. 12)
On the "File system" page, click the "Browse" button next to "From directory:" (Fig. 13)
Choose the directory where the source file resides and click "OK" (Fig. 14)
Click on all the source files on the right pane you want imported, for example,
the provided sample.c (or click the directory name on the left pane to import
all files in the directory), and click "Finish" (Fig. 15)
Click on the play button on the second menu bar
( ) to build and run the program:
On the "Create, manage, and run configurations" page,
double click on "C/C++ Local Application" (Fig. 16)
On the "sampleapp" configuration page, click "Run" (Fig. 17)