问题
I have this error on Ubuntu Eclipse that doesn't go away:
Invoking: GCC C++ Linker
g++ -L/usr/lib/i386-linux-gnu -o "GLUT" ./src/GLUT.o -lglut -lGLU
/usr/bin/ld: ./src/GLUT.o: undefined reference to symbol 'glEnable'
//usr/lib/i386-linux-gnu/mesa/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
I searched for glut:
# find / -name *glut.so*
/usr/lib/i386-linux-gnu/libglut.so.3
/usr/lib/i386-linux-gnu/libglut.so.3.9.0
/usr/lib/i386-linux-gnu/libglut.so
Then I went to: project properties > C/C++ Build > Settings GCC C++ Linker > Libraries :
// added
Libraries (-l): glut GLU
Library search path (-L): /usr/lib/i386-linux-gnu
The error is still the same. Any suggestion on what step should I have missed? All comments are highly welcome.
回答1:
You need to add also GL and GLU libraries, try adding them the same way.
来源:https://stackoverflow.com/questions/25632075/opengl-library-not-linking