PDA

View Full Version : compliling OpenGL on a HP-UX 10.X machine



muya
11-25-2002, 10:17 AM
I have been trying to complile a simple code to initialise and create a window. I know the code as 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/X11R6 -L/opt/graphics/OpenGL/lib -L/usr/lib/X11R6 -L/opt/graphics/OpenGL/contrib -L/opt/graphics/OpenGL/contrib/libglut -ldld -lGL -lGLU -lglut -lXhp11 -lXext -lXmu -lX11 -lm

The result is:
collect2: ld returned 1 exit status
/usr/ccs/bin/ld: Unsatisfied symbols:
glFlush (code)
glShadeModel (code)
glClear (code)
glClearColor (code)

Nothing
11-25-2002, 01:59 PM
It looks like the linker (ld) doesnt find the lib or doesnt like the format of the lib.

vijaykiran
11-25-2002, 06:49 PM
I am not an expert though. But i think you will have to interchange the order of the flags you used. Try using the following order:

-lglut -lGLU -lGL -lXhp11 -lXext -lXmu -lX11 -lm

instead of the order you used in ur makefile. Hope that helps!!

vijay.



Originally posted by muya:
I have been trying to complile a simple code to initialise and create a window. I know the code as 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/X11R6 -L/opt/graphics/OpenGL/lib -L/usr/lib/X11R6 -L/opt/graphics/OpenGL/contrib -L/opt/graphics/OpenGL/contrib/libglut -ldld -lGL -lGLU -lglut -lXhp11 -lXext -lXmu -lX11 -lm

The result is:
collect2: ld returned 1 exit status
/usr/ccs/bin/ld: Unsatisfied symbols:
glFlush (code)
glShadeModel (code)
glClear (code)
glClearColor (code)