Sunday, November 14, 2021

[SOLVED] undefined reference to symbol 'gluLookAt'

Issue

I'm using Fedora 16. I've installed freeglut and freeglut-devel packages. I tried to rum a simple opengl program, but i'm getting the following error

gcc cube.c -o cube -lglut
/usr/bin/ld: /tmp/ccSFol4w.o: undefined reference to symbol 'gluLookAt'
/usr/bin/ld: note: 'gluLookAt' is defined in DSO /usr/lib/libGLU.so.1 so try adding it to the linker command line
/usr/lib/libGLU.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

Solution

You have to link some gl libraries.

g++ cube.c -o cube -I /usr/lib/libglut.so.3 /usr/lib/libGL.so.1 /usr/lib/libGLU.so.1 -lGL


Answered By - Ferran Arau Castell