implicit declaration warnings

I don’t know what i am doing wrong here.

I believe i am including the correct header files, but i continue to get “implicit declaration of function ‘gl…’” warnings.

What do I have to do to make them go away.

Her is what I am including at the top of the file:

#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <GL/glx.h>

when I try to use the getprocaddress function to resolve the actual function, I get an error that says the initializer is not constant.

PFNGLISSHADERPROC glIsShader       = (PFNGLISSHADERPROC)   glXGetProcAddress( "glIsShader" );

what else am I missing?

[QUOTE=advorak;1271744]I believe i am including the correct header files, but i continue to get “implicit declaration of function ‘gl…’” warnings.

What do I have to do to make them go away.[/QUOTE]


#include <GL/gl.h>

I’m not sure if GL/glx.h is guaranteed to include GL/gl.h that contains the actual decralations, but even if, some functions
might not be declared in the gl.h header (i.e. the header is written against an older OpenGL(R) version). You might want to
include the header of an extension loader like GLEW or something similar (or your own) that declares the neccessary function
pointers and loads them.

Anyway, you get those warnings because the declarations are probably really not in the headers.

[QUOTE=advorak;1271744]
when I try to use the getprocaddress function to resolve the actual function, I get an error that says the initializer is not constant.

PFNGLISSHADERPROC glIsShader       = (PFNGLISSHADERPROC)   glXGetProcAddress( "glIsShader" );

what else am I missing?[/QUOTE]
Where did you write that code snippet? Inside a function or at global scope? I guess you are trying to statically initialize a global
variable with the return value of a function. In order to get the value, the function has to be called at run time. It is not possible
to determine the value at compile time, i.e. the initializer is not a known, constant value.

My glx.h does include gl.h as well as Xlib.h and Xutils.h.

I may be screwed up with where I am putting the line to get the proc address. It is at a global scope. I will move it into an init function.

Thank you for your help guys.