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

Undefined reference to `_imp__glewInit@0#39;(对 `_imp__glewInit@0 的未定义引用)
本文介绍了对 `_imp__glewInit@0' 的未定义引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我已经多次构建了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.

这篇关于对 `_imp__glewInit@0' 的未定义引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Prevent class inheritance in C++(防止 C++ 中的类继承)
Why should I declare a virtual destructor for an abstract class in C++?(为什么要在 C++ 中为抽象类声明虚拟析构函数?)
Why is Default constructor called in virtual inheritance?(为什么在虚拟继承中调用默认构造函数?)
C++ cast to derived class(C++ 转换为派生类)
C++ virtual function return type(C++虚函数返回类型)
Is there any real risk to deriving from the C++ STL containers?(从 C++ STL 容器派生是否有任何真正的风险?)