Get errors about redefinition (OpenGL 4.0 Shading Language Cookbook)

Started by
0 comments, last by tanzanite7 11 years, 2 months ago

I just tested the code in chapter 1 (OpenGL 4.0 Shading Language Cookbook)

I have installed Qt5, qmake -tp vc chapter01.pro then open it in vs2010.

Built and got many errors like:


1>D:\APP\Qt5\5.0.0\msvc2010\include\GLES2/gl2.h(38): error C2371: 'GLintptr' : redefinition; different basic types
1>          D:\OpenGL\glew-1.5.4\include\GL/glew.h(1615) : see declaration of 'GLintptr'
1>D:\APP\Qt5\5.0.0\msvc2010\include\GLES2/gl2.h(39): error C2371: 'GLsizeiptr' : redefinition; different basic types
1>          D:\OpenGL\glew-1.5.4\include\GL/glew.h(1614) : see declaration of 'GLsizeiptr'
1>D:\APP\Qt5\5.0.0\msvc2010\include\GLES2/gl2.h(96): warning C4005: 'GL_BLEND_EQUATION_RGB' : macro redefinition
1>          D:\OpenGL\glew-1.5.4\include\GL/glew.h(1666) : see previous definition of 'GL_BLEND_EQUATION_RGB'
1>D:\APP\Qt5\5.0.0\msvc2010\include\GLES2/gl2.h(474): error C2365: '__glewActiveTexture' : redefinition; previous definition was 'data variable'
1>          D:\OpenGL\glew-1.5.4\include\GL/glew.h(12027) : see declaration of '__glewActiveTexture'
1>D:\APP\Qt5\5.0.0\msvc2010\include\GLES2/gl2.h(475): error C2365: '__glewAttachShader' : redefinition; previous definition was 'data variable'

First, I didn't explicitly include gl2.h in this project. Second, I commented out all OpenGL headers and these errors still exist.

How to solve these problems? I have attached the chapter01 code in this post.

Thanks in advance

Advertisement
GLEW defines all OpenGL stuff - and you include GLES (OpenGL and OpenGL ES ARE DIFFERENT THINGS!) which expectedly tries to redefine a lot of similarly named stuff. What do you actually want? OpenGL or OpenGL ES?

This topic is closed to new replies.

Advertisement