View Full Version : help, programming with opengl

07-16-2014, 09:51 PM
Hi, I started to programming en CodeBlocks with C, using OpenGL, I used the functions gluInit, gluInitWindowSize, etc, I created a triangle, but when I want to change the perspective with gluLookAt, appears a message "undefined reference to 'gluLookAt' "

I think need a header

In compiler settings, I added "-I/usr/include"
In linker setting, I added "-L/usr/lib -lGL -lGLEW -lglut"
I have installed freeglut (-devel), mesa-libGL (-devel), mesa-libGLU (-devel), mesa-libGLw (-devel)

Agent D
07-17-2014, 02:45 AM
The functions are called glutInit and glutInitWindowSize because they are parts of GLUT, the GL Utillity Toolkit.
They are linked propperly, because you link with "-lglut".

gluLookAt doesn't have a glut, but a glu prefix. It is part of GLU, the GL Utility library. You need to link againgst GLU,
i.e. you are missing "-lGLU" in your linker settings.