glGenBuffers execution error

I am learning the 3.x buffer manipulation commands (environment MS VC++ 2010, W7). Having commented out most everything else in a program, I get the execution error

Unhandled exception at 0x00000000 in BufCom.exe: 0xC0000005: Access violation.


glGenBuffers(1, buffers);

If I comment out glGenBuffers() there’s no problem. So what am I doing wrong? Btw, buffers is defined by GLuint buffers[2] so it’s big enough.

Thanks in advance,

It sounds like you haven’t retrieved the glGenBuffers function entry point. OpenGL32.dll only exposes OpenGL 1.1 entry points + all the rest have to be retrieved using wglGetProcAddress (or alternative similarly named function for different platforms). GLEW or similar extension loading libraries will make this much easier for you.

Here you go
Specially this part

Thanks, Dan and V-man.
I forgot to put glewInit() in main so GLEW never initialized.