Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

g++ linker: /usr/lib/libGL.so.1: could not read symbols: Invalid operation

I'm trying to build a very simple OpenGL-app under Ubuntu 10.04 (I have a 32 bit system).

When I'm trying to compile the file, I get the error message:

g++ -L/usr/lib simple.cpp -lglut
/usr/bin/ld: /tmp/ccoPczAo.o: undefined reference to symbol 'glEnd'
/usr/bin/ld: note: 'glEnd' is defined in DSO //usr/lib/libGL.so.1 so try adding it to the linker command line
//usr/lib/libGL.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

Does anybody know what I'm doing wrong?

like image 531
phimuemue Avatar asked Aug 13 '10 12:08

phimuemue


1 Answers

You need to include the opengl library on the command line as well as the glut library/. Try adding -lGL to the end of your command line

g++ -L/usr/lib simple.cpp -lglut -lGL
like image 94
jcoder Avatar answered Oct 28 '22 15:10

jcoder