Failed to Compile GLFW-2.7.8 on Linx ( Ubuntu 12.10 64 bits )

lixuan24 wrote on Friday, April 19, 2013:

Hello, I want to compile GLFW-2.7.8 with OpenGL 3.X (or 4.X), because I want to use some new features. Here is all what I did:

First I installed the latest driver of ATI Graphics Card Radeon 5000 series.

  1. The fglrxinfo command gave me the following information: OpenGL version string: 4.2.12002 Compatibility Profile Context 9.012.
  2. glATI.h and glxATI.h were generated under /usr/include/GL/

Then I installed GLEW-1.9.0.

After that since I don’t have glu.h, I use sudo apt-get install libglu1-mesa-dev. However I was forced to install its dependency libgl1-mesa-dev ( I think it is a simulator of OpenGL and its version is far behind OpenGL provided by my ATI Driver).

  1. glu.h gl.h glx.h were generated under /usrinclude/GL/
  2. I delete gl.h and glx.h (For the reason that I think they are generated by libgl1-mesa-dev and I don’t want to use meas OpenGL the version of which is old)

I changed the name of glATI.h and glxATI.h which were generated after installing ATI driver into gl.h and glx.h. I hope this might inform my compiler to use the OpenGL provided by my ATI driver.

At last, I tried to compile GLFW-2.7.8. I use make x11-install commmand. A lot of error message like the following kind occurred:
/usr/include/GL/gl.h:3790:26: error: expected declaration specifiers or ‘…’ before ‘’ token*

The corresponding line in gl.h is:
typedef GLvoid (APIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);

Thank you for reading my problems.
Please help me.

PS. I also tried to use gl.h and glx.h provided by libgl1-mesa-dev instead of renamed glATI.h and glxATI.h, the GLFW-2.7.8 complied successfully. But I don’t know whether it will give me the new feature of OpenGL, since mesa OpenGL is not 3.0 or 4.0 version.