# glGenVertexArrays Access Violation/segfault with GLEW

If you’ve been copying the code from the chapters, you may run into trouble when your program hits the glGenVertexArrays function in the form of an Access Violation/segfault.

To fix this, add the following statement right above your call to glewInit:

glewExperimental = GL_TRUE;

There seems to be some trouble with GLEW not entirely supporting the Core Profile out of the box, but the above fix should get you by for the time being.

This entry was posted in Information and tagged , , . Bookmark the permalink.
• przemo_li

There is new GLEW 1.6.0 out there. Just few days old!
Change log claims some bug fixes and 8 new extensions incorporation.

I do not compile your code, so I do not know if it solve this issue, but I would like to see blog entries about new versions of GLEW, FreeGLUT, DevIL if they bring something new to your book.

And blog entries about setting dev environments up. I know that this info will eventually get included as appendixes in your book, but let me point out that we (readers) can post comments below blog entries but not below book chapters. So ironing out any problems in blog entry may be profitable. And will enable to share info about setting up opengl on various platforms by us (your humble readers ) and about our experience with it.

• http://openglbook.com/ Eddy Luten

Thanks for the comment, I’ll double-check later today to see if the problem persists with the new version of GLEW.

PS, not being able to post comments on the Chapters is done purposely. I’d rather have reader input on blog posts than extending the length of the chapters even further with discussions.

• http://openglbook.com/ Eddy Luten

It’s still the case with GLEW 1.6.0, no change in this case.

• VarG

Just use gl3w https://github.com/skaslev/gl3w and no problems

• http://openglbook.com/ Eddy Luten

Trying to keep the book purely C — gl3w requires Python to generate the C source files. Looks like a nice little tool for OpenGL development, though.

• SlickMcRunFast

Anything new coming? It has been awhile.

• http://openglbook.com/ E. Luten

Yes, pretty soon.