Error on 3.2 or newer context.

I have a problem using GLFW and GLEW. When I ask for a 3.3 or 3.2 context, I get an GL_INVALID_ENUM error after calling glewInit(). However when I ask for a 3.1 or 3.0 context I don’t get any error. I am using the latest version of GLEW, and the latest catalyst drivers.
int main() {
int err;

if (glfwInit() != GL_TRUE) {
    glfwTerminate();
    return 1;
}

glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);


if (glfwOpenWindow(640, 480, 8, 8, 8, 0, 0, 0, GLFW_WINDOW) != GL_TRUE) {
    glfwTerminate();
    return 1;
}

err = glewInit();
if (GLEW_OK != err)
{
    glfwTerminate();
    return 1;
}

err = glGetError(); // Here I get GL_INVALID_ENUM

// Output some info to console
std::cout << glGetString(GL_VERSION);
err = glGetError();

I found the cause of the problem. GLEW was calling glGetString() with GL_EXTENTIONS as argument, which is deprecated. I replaced those calls, and the error message went away.

Thanks for revealing the solution for your own issue :slight_smile:
I do also use GLFW (gl 2.1 context yet) but i manage the extensions with my own extension library.

cheers