PDA

View Full Version : dumb newbie help



12-25-2001, 09:09 PM
I have the read book and I'm trying to get the first example running.
I use:

gcc -lGL -lGLU -lglut program.c

and get /path/libGL.so: undefined reference to 'pow'. I would guess this is because I'm not linking to something. I also thought maybe 'pow' was a power function from some math library because when I was trying to compile other examples it was saying undefined reference to 'sin' and 'cos'. I don't really know though.
I am running Red Hat linux 7.1. Any help would be appreciated.

rixed
12-26-2001, 07:34 AM
add -lm to link with the libm (math library)

it should do it.

12-26-2001, 03:16 PM
Wow, it works. Thanks.