Compiling OpenGL on HP-UX 10.x

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
-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)

It seems to me from your output that the compiler works just fine. The problems you’re posting are link errors. Link errors are generated by the linker if it doesn’t find symbols that you are declaring and using. Typically this means that you’re forgetting to link with some library, whose headers you are including and using.

By the way: this is not the appropriate forum for getting support for your development tools, nor to learn the difference between compiling and linking or how to interpret the output of your compiler. I suggest some HP/UX user forum, or Usenet group.