Tag: glew

glew之前包含gl.h,但GLFW需要gl.h

我记得你订购#include-s的方式。 好吧,我有点麻烦了。 我有这两个标题: #include #include 如果我运行它,我得到一个错误,说gl.h包含在glew.h之前。 但是如果我颠倒那两个的顺序以便glew.h是第一个,我会得到很多错误。 我只是在考虑搜索#define-s的含义,所以我只能对我说:#define whatineed 0x0000x。 如何使用标题排列来解决此问题。 狩猎和使我的定义安全的方法?

glCreateShader正在崩溃

我应该有Glew和Glut的最新版本,所以这应该不是问题。 一切都应该链接,我正在使用MS visual studio 2010.我的程序编译但是当我到glCreateShader(GL_FRAGMENT_SHADER)它显示错误:“0xC0000005:访问冲突。” 我的节目: #include #include #include #include GLuint program; static char* readShaderSource(const char * shaderFile) { FILE* fp = fopen(shaderFile, “r”); char* buf; long size; if (fp == NULL) return NULL; fseek(fp, 0L, SEEK_END);//go to end size = ftell(fp); //get size fseek(fp, 0L, SEEK_SET);//go to begining buf = (char*) malloc((size +1) * […]

如何使用GLEW与MinGW

我试图在我的项目中使用glew32.lib文件链接,而不是自己编译Glew源来获取glew.a文件。 现在,我的项目中存在以下链接错误: g++ -o Chapter10(OpenCLTest).exe src\Chapter10(OpenCLTest).o -lopengl32 -lglew -lglut32 -lglu32 -lopencl src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x167): undefined reference to `_imp____glewBindBuffer’ src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x39a): undefined reference to `_imp__glewInit’ src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x3a7): undefined reference to `_imp__glewIsSupported’ src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x48a): undefined reference to `_imp____glewGenBuffers’ src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x495): undefined reference to `_imp____glewBindBuffer’ src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x4dd): undefined reference to `_imp____glewBufferData’ src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x50b): undefined reference to `_imp____glewGetBufferParameteriv’ src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x1d67): undefined reference to `_imp____glewBindBuffer’ src\Chapter10(OpenCLTest).o:Chapter10(OpenCLTest).cpp:(.text+0x1d7f): undefined reference to […]