link with glew functions


I am trying to run some openGL code from an article that uses the glew library in an OF app.

The code uses glGenFramebuffers function, that is defined in glew.h this way:
#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers)

The OF app includes in its linker settings the static library:

However I get a linking error:
undefined reference to ‘_imp____glewGenFramebuffers’

I am lost about how the linker pass from __glewGenFramebuffers to _imp____glewGenFramebuffers.

How can I make the program to link with function like glGenFramebuffers, glBindFramebuffer, etc.?


I managed to link including “ofMain.h” in the file that make uses of glew functions.

But to make it work I have had to change it form .c to .cpp.

If I include “ofMain.h” in a flat c file it gives a lot of linking errors.