C ++ OpenGL Eclipse MinGW链接错误

时间:2016-07-07 12:21:47

标签: eclipse opengl mingw static-libraries static-linking

我正在尝试使用SDL在Eclipse中运行一些OpenGL代码,但仍然遇到链接错误。我已经正确链接了SDL .a文件(因为我已经自己测试了它们并且它们已经工作了)但是当涉及到libglew32.a和libopengl.a时,我的程序陷入停顿。我也插入了

#define GLEW_STATIC.

这是一个不断弹出的错误。

main.o:main.cpp:(.text+0x28): undefined reference to `glewExperimental'
main.o:main.cpp:(.text+0x2e): undefined reference to `glewInit@0'
main.o:main.cpp:(.text+0xcc): undefined reference to `glClearColor@16'
main.o:main.cpp:(.text+0xf3): undefined reference to `glViewport@16'
main.o:main.cpp:(.text+0x153): undefined reference to `__glewGenVertexArrays'
main.o:main.cpp:(.text+0x16b): undefined reference to `__glewGenBuffers'
main.o:main.cpp:(.text+0x17b): undefined reference to `__glewBindVertexArray'
main.o:main.cpp:(.text+0x193): undefined reference to `__glewBindBuffer'
main.o:main.cpp:(.text+0x1bb): undefined reference to `__glewBufferData'
main.o:main.cpp:(.text+0x1cb): undefined reference to `__glewEnableVertexAttribArray'
main.o:main.cpp:(.text+0x203): undefined reference to `__glewVertexAttribPointer'
main.o:main.cpp:(.text+0x21b): undefined reference to `__glewBindBuffer'
main.o:main.cpp:(.text+0x22b): undefined reference to `__glewBindVertexArray'
main.o:main.cpp:(.text+0x263): undefined reference to `__glewDeleteVertexArrays'
main.o:main.cpp:(.text+0x277): undefined reference to `__glewDeleteBuffers'
main.o:main.cpp:(.text+0x2a8): undefined reference to `glClear@4'
main.o:main.cpp:(.text+0x2b8): undefined reference to `__glewBindVertexArray'
main.o:main.cpp:(.text+0x2d7): undefined reference to `glDrawArrays@12'
main.o:main.cpp:(.text+0x2e7): undefined reference to `__glewBindVertexArray'

我已经解决了

带来的错误
__imp__gl.. and wgl

但不是当前的问题。有人可以帮助我解决我的问题吗?

0 个答案:

没有答案