I have been trying to complile a simple code to initialise and create a window. I know the code has no bugs since a copied it from a tutorial. I also checked that I was referencing to the correct library. When I use cc to compile my program it gives me a bunch of errors in gl.h. But when I use gcc, the compliler finds the GL library but doesn’t find glFlush, glClear or any other GL function. Here is what I use to compile and the result that I get.
gcc -o main main.c -I/opt/graphics/OpenGL/include -I/opt/graphics/OpenGL/contrib/libglut
-I/usr/include/X11R4
-L/opt/graphics/OpenGL/lib -L/usr/lib/X11R4
-L/opt/graphics/OpenGL/contrib -L/opt/graphics/OpenGL/contrib/libglut -ldld -lGL -lGLU -lglut -lXhp11 -lXext -lXmu -lX11
The result is:
collect2: ld returned 1 exit status
/usr/ccs/bin/ld: Unsatisfied symbols:
glFlush (code)
glShadeModel (code)
glClear (code)
glClearColor (code)