c++ - OpenGL 库未链接

标签 c++ eclipse opengl shared-libraries

<分区>

我在 Ubuntu Eclipse 上有这个错误并没有消失:

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

我搜索过剩:

# 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

然后我去了:项目属性 > C/C++ 构建 > 设置 GCC C++ 链接器 > 库:

// added
Libraries (-l): glut GLU
Library search path (-L): /usr/lib/i386-linux-gnu

错误还是一样。关于我应该错过哪一步的任何建议?非常欢迎所有评论。

最佳答案

您还需要添加 GL 和 GLU 库,尝试以相同的方式添加它们。

关于c++ - OpenGL 库未链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25632075/

相关文章:

c++ - 64bit和32bit进程互通boost::message_queue

opengl - 如何解决 MinGW 中的这些 OpenGL 链接问题?

c++ - 如何在 VBO 中使用步幅参数?

c++ - OpenCV:如何从提供的图片中检测粗红线及其轮廓

C# 到 C++ : Convert C# Time calculation to C++ chrono

java - eclipse egit 无法连接到远程仓库

eclipse - 同步代码存储库中的 Eclipse .classpath

java - 在eclipse中输入注释 block

opengl - 统一位置和统一索引的区别?

c++ - 带有2个渲染器的VTK摄像机剪辑