Missing GL version

So I isntalled glew, all good, but my altgorithm didn’t worked propely, and I put this in my script

    GLenum err = glewInit();
    if(err != GLEW_OK)
        cout << "Error(glew): " << glewGetErrorString(err) << endl <<"Current version of OpenGL: " <<glGetString(GL_VERSION);
        return EXIT_FAILURE;

but it’s getting me a ugly error

Error(glew): Missing GL version
Current version of OpenGL:
Process returned 1 (0x1)   execution time : 0.585 s

I reinstalled code blocks, and in order to reset it, I deleted it with revo unistaller. So anybody help?