I'm trying to compile some code using glew.h and glext.h. Here's a minimal example:
#include <GL/glew.h>
//#include <GL/gl.h> // commenting it doesn't change anything
#include <GL/glext.h>
int main(){
return 0;
}
I have 6 compile-time errors because of different function prototypes. The first one is:
In file included from main.cpp:3:0:
/usr/include/GL/glext.h:12306:105: error: conflicting declaration ‘typedef void (* PFNGLFRAGMENTLIGHTFVSGIXPROC)(GLenum, GLenum, const GLfloat*)’
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
^
In file included from main.cpp:1:0:
/usr/include/GL/glew.h:16092:28: note: previous declaration as ‘typedef void (* PFNGLFRAGMENTLIGHTFVSGIXPROC)(GLenum, GLenum, GLfloat*)’
typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
glew.h:16092:
typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params);
glext.h:12306:
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
The difference is the constness of * params.
I'm on Ubuntu 18.04.5 LTS with mesa 20.0.8, glew 2.0.0-5 and gcc 7.5.0 (should I upgrade to Ubuntu 20?).