How to get OpenGL headers (with nvidia driver)


I am getting crazy with that for about 6h.
I have currently the NVidia driver (319) installed from the repository. 3D acceleration work and the driver seem to support OpenGL 4.3.

I am trying to programme a simple OpenGL sample (just a triangle in a glut windows), but I am unable because GL/gl.h is outdated: the current header is the mesa with openGL 1.3, which does nos support glCreateShader, glAttachShader…

I have tryed $ sudo find / -name gl3.h (openGL 3.1 and further should include this header) but it does not return any result, so I suppose Nvidia driver does not include library/headers.

My question is: Where can I get the GL/gl.h for the installed NVidia driver?

Adrian M.

Why not tell us the openSUSE version and desktop you have installed. Have you installed the proprietary video driver and if so,how did you install it? Tell us about your nVIDIA hardware and if you are a big gamer or not.

Thank You,

First of all, thanks you for the answer jdmcdaniel3 :slight_smile:

My OpenSuse version is 12.2 (x86_64) Mantis, with KDE desktop.

To install the NVidia driver, I just installed the driver from the NVidia repository for opensuse 12.2 ( (with Yast)
I have installed:

  • nvidia-computeG03 (NVIDIA driver for computing with GPGPU)
  • nvidia-gfxG03-kmp-desktop (NVIDIA graphics driver kernel module for GForce 8xxx and newer GPUs)
  • x11-video-nvidiaG03 (NVIDIA graphics driver for GeForce 8xxx and newer GPUx)

You could go with the latest X11 repo for openSUSE 12.2 but be aware that this will effect your main display setup. Its too bad you can’t use a VM for such testing. One thing is for sure, I would use a dual boot setup where I kept my primary openSUSE install more or less straight while playing with a secondary copy. Here is that X11 repo for openSUSE 12.2, once added, you must switch to using it. Always back up important data before making a change that might stop the graphics system from working. Look the repo over first for file versions:

Index of /repositories/X11:/XOrg/openSUSE_12.2

Thank You,

Thanks you again for the help.

I have solved the problem, and it was not a driver problem but something else.

Even if OpenGL 3 and 4 use mandatory shaders to show anything, shaders functions (glCreateShaders, glAttachShader…) are not in the default core and require to be enabled, which require special code to find functions pointers: the GLEW library (there are also other solutions) allow to access these functionalities.


  • Download the GLEW library from the openGL web page: OpenGL Loading Library -
  • Include it before gl.h and glext.h ( and also link the library: .a or .so)
  • Inithalise GLEW:

glewExperimental = GL_TRUE; //necesario para usar OpenGL moderno 
// inicializamos GLEW 
if (glewInit() != GLEW_OK) { 
    cout <<  "Cannot init GLEW
" << endl; 
    return -1; 

I hope that may help further users.

Very happy you found a good solution to your problem and sharing with us. If we can help in any other way, just let us know what the problem is.

Thank You,