OpenGL library not linking [duplicate]

妖精的绣舞 提交于 2021-02-10 14:29:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!