Compiling,
Linking and Executing OpenGL Programs on Linux Machines
Freeglut (an equivalent of GLUT) has been installed on all cslab machines, cslab1.sandiego.edu through cslab12.sandiego.edu, except for cslab8, which is down.
1. Transfer the C/C++ source code file into a cslab system. Suppose the file is called ‘lgnepo.c’.
2. You may have to do some minimal modifications of the code from class, e.g. , change the Windows backslash directory separator to UNIX frontslash (instead of #include <GL\glut.h>, you need #include <GL/glut.h>”. You can use the simple ‘pico’ editor to edit the file:
pico lgnepo.c
3. Compile the source code, and link it with the GLUT package with the command:
gcc –o lgnepo lgnepo.c -lglut
4. The file ‘lgnepo’ is now an executable. Type the command
lgnepo
and enjoy the fruits of your labor.