'GL_RENDERBUFFER_BINDING_EXT' was not declared

Hi
It compiles on Linux/Mac but on Windows I get the errors below.
Many thanks
Michael

…\main.cpp:50:15: error: ‘GL_CURRENT_PROGRAM’ was not declared in this scope
…\main.cpp:51:15: error: ‘GL_FRAMEBUFFER_BINDING_EXT’ was not declared in this scope
…\main.cpp:61:22: error: ‘GL_FRAMEBUFFER_EXT’ was not declared in this scope
…\main.cpp:61:45: error: ‘glBindFramebufferEXT’ was not declared in this scope
…\main.cpp:68:15: error: ‘glUseProgram’ was not declared in this scope
…\main.cpp: In function ‘int XPluginEnable()’:
…\main.cpp:269:15: error: ‘GL_RENDERBUFFER_BINDING_EXT’ was not declared in this scope
…\main.cpp:270:15: error: ‘GL_FRAMEBUFFER_BINDING_EXT’ was not declared in this scope
…\main.cpp:285:36: error: ‘glGenRenderbuffersEXT’ was not declared in this scope
…\main.cpp:286:23: error: ‘GL_RENDERBUFFER_EXT’ was not declared in this scope
…\main.cpp:286:53: error: ‘glBindRenderbufferEXT’ was not declared in this scope
…\main.cpp:287:47: error: ‘GL_DEPTH_COMPONENT32’ was not declared in this scope
…\main.cpp:287:77: error: ‘glRenderbufferStorageEXT’ was not declared in this scope
…\main.cpp:290:29: error: ‘glGenFramebuffersEXT’ was not declared in this scope
…\main.cpp:291:22: error: ‘GL_FRAMEBUFFER_EXT’ was not declared in this scope
…\main.cpp:291:45: error: ‘glBindFramebufferEXT’ was not declared in this scope
…\main.cpp:292:47: error: ‘GL_COLOR_ATTACHMENT0_EXT’ was not declared in this scope
…\main.cpp:293:28: error: ‘glFramebufferTexture2DEXT’ was not declared in this scope
…\main.cpp:294:50: error: ‘GL_DEPTH_ATTACHMENT_EXT’ was not declared in this scope
…\main.cpp:295:31: error: ‘glFramebufferRenderbufferEXT’ was not declared in this scope
…\main.cpp: In function ‘void XPluginDisable()’:
…\main.cpp:307:32: error: ‘glDeleteFramebuffersEXT’ was not declared in this scope
…\main.cpp:309:39: error: ‘glDeleteRenderbuffersEXT’ was not declared in this scope

Sounds like you didn’t include all needed OpenGL headers.
On Windows you will need an extension loader like glew.

Thanks now I did:

#include <GL/glew.h>

in init function:

GLenum err = glewInit();
if (GLEW_OK != err)
{
/* Problem: glewInit failed, something is seriously wrong. */
fprintf(stderr, "Error: %s
", glewGetErrorString(err));
}

but still get tons of as below. What to do?
Many thanks
Michael

**** Build of configuration Debug for project terrainFBO ****

**** Internal Builder is used for build ****
g++ -LE:\CPP-Win\SDK\Libraries\Win -shared -olibwin.xpl main.o -lopengl32 -lglu32 -lgdi32 -lglew32s -lXPLM
Warning: .drectve /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized e:/cpp-win/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../glew32s.lib(./static/release/glew.obj)Sad.text[__glewInit_GL_VERSION_1_2]+0x4): undefined reference to_imp__wglGetProcAddress@4’
e:/cpp-win/mingw/bin/…/lib/gcc/mingw32/4.6.1/…/…/…/glew32s.lib(./static/release/glew.obj)Sad.text[__glewInit_GL_VERSION_1_3]+0x4): undefined reference to _imp__wglGetProcAddress@4' e:/cpp-win/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../glew32s.lib(./static/release/glew.obj)Sad.text[__glewInit_GL_VERSION_1_4]+0x4): undefined reference to_imp__wglGetProcAddress@4’
e:/cpp-win/mingw/bin/…/lib/gcc/mingw32/4.6.1/…/…/…/glew32s.lib(./static/release/glew.obj)Sad.text[__glewInit_GL_VERSION_1_5]+0x4): undefined reference to `_imp__wglGetProcAddress@4’

Try defining GLEW_STATIC while building and try rearranging your linking order, building on windows can be sensitive to the order the OpenGL/glew related libs are added to the linker.

Yes I do link: opengl - glu - glew32s and defined static. Still the same with Eclipse/MingW on Vista. But I got the very same working in VC2008. Any more ideas? Thanks.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.