对 `_imp__glewInit@0' 的未定义引用

2021-12-19 00:00:00 opengl c++ codeblocks mingw32 glew

我已经多次构建了glew lib.我的最后一次构建删除了对所有着色器函数的未定义引用,例如 glCreateShader().我认为这个版本是正确的,因为我发现 Code:Blocks 可以打开 Visual Studio 6.0 项目,所以它为我准备了一切.

I have built the glew lib so many times. My last build removed the undefined references to all the shader functions such as glCreateShader(). I think this build is the correct one cause I found out that Code:Blocks can open Visual Studio 6.0 projects so it had everything laid out for me.

我可以在不调用 glewInit() 的情况下编译我的应用程序,但是当 glCreateShader() 被调用时它会导致一个 SEGFAULT.这是由于未初始化发光引起的.

I can compile my app without calling glewInit() but it results in a SEGFAULT right when glCreateShader() is called. Which is caused by not Initializing glew.

我需要打开它但它不会让我XD

I need to turn it on but it wont let me XD

链接:mingw32、glew32、opengl32、glu32、glut32

links: mingw32, glew32, opengl32, glu32, glut32

IDE:代码::块

编译器:MinGW32

Compiler:MinGW32

推荐答案

省去很多麻烦,只需将 glew.c 直接添加到您的项目中即可.我不明白为什么人们如此努力地从外部链接到它.许可证是友好的,它只是一个源文件.只记得#define GLEW_STATIC.

Save yourself a lot of trouble and just add the glew.c to your project directly. I do not understand why people fight so hard to link to it externally. The license is friendly, and it is only one source file. Just remember to #define GLEW_STATIC.

相关文章