Jump to content

  • Log In with Google      Sign In   
  • Create Account


Get errors about redefinition (OpenGL 4.0 Shading Language Cookbook)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 superwave   Members   -  Reputation: 200

Like
0Likes
Like

Posted 06 February 2013 - 09:53 AM

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

Attached Files



Sponsor:

#2 tanzanite7   Members   -  Reputation: 1221

Like
0Likes
Like

Posted 07 February 2013 - 11:37 AM

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?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS