Can't compile, link or run

Could somebody give me detailed Instructions on how to compile, link and run OpenGL(GLUT)-Code under Linux?
When I compile with gcc, I get some cryptic error-messages, one for each called GLUT-function. It says that they are not defined, but everything I found about Mesa, GLX and GLUT on my distribution packages(SuSE 6.3/7.2) is installed.
When I try a makefile of one of the redbook- or GLUT-demos, it says that there is no target defined, but in the makefile there is a warning not to change it.
By the way, what is ’ Imake’?
And at last, when I try to run a pre-compiled OpenGL-binary, I get following message:
GLUT: Fatal Error in ‘programname’: OpenGL GLX extension not supported by display: :0
What means ‘display’? Has it something to do with my X-configuration or my graphics-card (Diamond Viper V550(Riva TNT), had no problems writing OpenGL programms with MS-Windows)
Can somebody help me?! Thanks!

1)You have to tell gcc to link your program with the GLUT and the other library needed:
this is done with the option -l<lib_name>
Try to compile you programs with:
gcc -Wall -I/usr/X11R6/include/ -L/usr/X11R6/lib -o <exec_name> <source_name>.c -lX11 -lXi -lXmu -lXext -lglut -lGL -lGLU -lm -lpthread -ldl

2)“make” is a program that reads a file generally called “Makefile” to compile your source code It checks the modification time of the source files in order to compile only those changed, so reducing the compile time. It is useful when you have a project with many .c and .h files. You have to type ‘make’ in the same directory where the Makefile you want to process is.

  1. Try to visit the site of your card’s manufacturer and serarch for Linux drivers with GLX extensions.(You should find there also the instructions to modify the configuration files)

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.