Glew Missing GL Version error

I’m trying to use glew and i’ve installed the libglew-dev package but when I call glewInit() I get the “Error: Missing GL version”.

I believe I have openGL 2.0 driver support.

fglrxinfo

display: :0.0  screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: RADEON 9550/X1050 Series
OpenGL version string: 2.0.6334 (8.34.8)

A portion of glewinfo

GL_VERSION_2_0:                                                OK 
---------------
  glAttachShader:                                              OK
  glBindAttribLocation:                                        OK
  glBlendEquationSeparate:                                     OK
  glCompileShader:                                             OK
  glCreateProgram:                                             OK
  glCreateShader:                                              OK
  glDeleteProgram:                                             OK
  glDeleteShader:                                              OK
  glDetachShader:                                              OK
  glDisableVertexAttribArray:                                  OK
  glDrawBuffers:                                               OK
  glEnableVertexAttribArray:                                   OK

You probably have to create a OpenGL context before calling glewInit()

how does one create an OpenGL context (simplest possible way that will allow one to use GLew)?

under Windows

bool initGL()
{
PIXELFORMATDESCRIPTOR pfd;
HWND hwnd; HDC hdc; int pixelFormat;
memset(&pfd,0,[b]sizeof/b);
pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 32;
pfd.cDepthBits = 16;
pfd.iLayerType = PFD_MAIN_PLANE;

hwnd = CreateWindowEx(WS_EX_TOOLWINDOW,“STATIC”,“glctx”,
WS_POPUP|WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
0,0,640,480,0,0,GetModuleHandle(NULL),0);
if(!hwnd) return false;
ShowWindow(hwnd,SW_HIDE);

hdc = GetDC(hwnd);
pixelFormat = ChoosePixelFormat(hdc,&pfd);
SetPixelFormat(hdc,pixelFormat,&pfd);
wglMakeCurrent(hdc,wglCreateContext(hdc));
[b]return[/b] wglGetCurrentContext() != NULL;

}[/b]

NK47> obeseogre is apparently not working on windows.

the simplest way is to use freeglut. I would not have to care about OS specific way of creating a rendering context.

sorry, my fault. :o anyways, maybe someone needs a short version for windows.

Hi, I have the same problem as obeseogre, but I’m using wxWidgets and I have already created an object of the class wxGLContext before I call glewInit. However, I also get the error “Missing GL version” from glewInit.

What do you think is the most likely cause for the error? The error message certainly doesn’t help very much by itself since I think that I already have all OpenGL versions that glew needs. I’m not sure whether wxGLContext creates an OpenGL context immediately when it’s created, though, but I think it would be strange if it didn’t.

I managed to find the reason for the problem. A wxGLContext doesn’t automatically create an OpenGL context when it is created itself. First when the wxGLCanvas it is supposed to work with have been displayed and selected as the current canvas using SetCurrent(), the OpenGL context is created and then glewInit() can be called.

Please stop replying to threads that are years old. Look at the date of the last reply. If it’s from 2010 or earlier, don’t bother. Just make a new thread.

Well, the threat can still be found on google, so it’s apparently not that outdated yet.

Well, the threat can still be found on google, so it’s apparently not that outdated yet.

It’s not a question of information being outdated. It’s a question of you unearthing threads which most of the original contributors have moved on from. Either the problem was solved or they don’t care anymore. Your input isn’t helping them.

If you have a question or problem, just start a new thread and ask. The original thread isn’t helping to get your question answered. Making a new thread allows us to focus on helping you, without having to figure out whether we’re talking to people who haven’t visited the site in years.

I hope it’s not a problem that I’m writing here? If you do think so, you have to consider that posting an answer here now might still help other people, just like me, in the future, since google will continue to link to it. I know that the original thread maker has probably already found his/her answer, so it is not him/her that I want to help in the first hand.

If you do think so, you have to consider that posting an answer here now might still help other people, just like me, in the future, since google will continue to link to it.

Google will also find your new thread. So there’s no problem.

I know that the original thread maker has probably already found his/her answer, so it is not him/her that I want to help in the first hand.

So why post in the thread? If you’re not here to help the person who originally asked the question, what purpose does it serve to post in their thread?

If someone doesn’t look at the date on a post, it is very easy for them to accidentally start replying to people who are no longer interested in the question or not around anymore. After all, most active topics (those with new replies) are recent. This has happened many times in the past when people have unearthed dormant threads. It doesn’t help anyone.

The only difference between making a new thread and unearthing an old one is that you make these kinds of mistakes impossible if you make a new thread. There are only benefits from making new threads.

The purpose you are asking for was stated in my previous post.

They say in all forums that you are supposed to search for old threads; I figured that was because they didn’t want so man new threads. Maybe you should PM me if you want to discuss this more since this is off topic.

Old threads are a good source of information.

Start a new thread and ask in the right forum. Qt is a toolkit so your question goes here
http://www.opengl.org/discussion_boards/

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