GLEW missing GL version but valid context

Hey
i'm using glew and glfw3.
In my code, I init glfw3 first, then I create a window and its context, and then I try to initialize glew.
I get the "missing gl version" error.
I compiled on windows sources myself.
Here are my preprocessors for compiling glfw :
_GLFW_WIN32;_GLFW_WGL;_GLFW_USE_OPENGL;_GLFW_BUILD_DLL;
and for glew :
WIN32;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;GLEW_BUILD;
Here is my code :

`GLFWwindow* window;
glfwSetErrorCallback(error_callback);
if (!glfwInit())
exit(EXIT_FAILURE);
window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
if (!window)
{
glfwTerminate();
exit(EXIT_FAILURE);
}
glfwMakeContextCurrent(window);
std::cout << glGetString(GL_VERSION) << std::endl;

glewExperimental = true;
GLenum err = glewInit();
if (err != GLEW_OK) {
std::cerr << "Failed to init GLEW !" << std::endl << glewGetErrorString(err) << std::endl;
glfwTerminate();
return 1;
}`

glGetString(GL_VERSION) does return my opengl version ! (4.5.0)
And I tried with glewExperimental = false too

After some debugging, I found that this is causing the error :
getString = (PFNGLGETSTRINGPROC) glewGetProcAddress((const GLubyte*)"glGetString"); if (!getString) return GLEW_ERROR_NO_GL_VERSION;

That means glew can't get that string...

Can somebody help me please ?
Topic archived. No new replies allowed.