segmentation-fault in glCreateShader(GL_VERTEX_SHADER) ...

Hi all,
I’ve had some steeple-chase moving my code to GLEW & GLFW. Loading the shaders from file was a particular hassle. The coding compiles without errors, but it generates a segmemntationfault on execution when calling
vertShader = glCreateShader(GL_VERTEX_SHADER);
when I tab through the lines debugging.

dgb, mingw, win7.

any suggestions ?
I cannot yet use ‘glext_ARB_debug_output’ … should I look for function-pointers to load that applies to the situation?

Make sure you have initialized your OpenGL context

Hi Tonyo
Can you throw a bone of code or better, point to an appropriate source of info?
As said I try to use GLEW & GLFW. The GLFW userguide shows a minimal program with a window. How can that come by without a context created somewhere BEHIND the scene?
I entered a new setup with GLEW and GLFW3, and that GLFW3 has atleast some makeContextCurrent() - but - I have not been able to get GLEW going there and GLFW/GLFW3 gets initiated … but none of it’s functions works anyway (neither new or old). I’ve probably been linking to the wrong libraries, so I’ve thrown some attention to MinGW and Code::Blocks.

I’ve found some MinGW-compatible libraries and a post about some of MinGW’s shortcommings as for MSVC-generated libs - but havn’t tried it out yet. I’m hopefull.

GLEW has an init call glewInit() that you call after you have created your window with GLFW but before you do anything else. It creates the jump table for all function other than those defined in OpenGL 1.1

Hi Tonyo,
I finally got glew and glfw3 working and has started testing my code. Alas … it looks really good ;o)

dooo …
The exact same problem exists.
I think that I’ll need to compile GLEW on MinGW/Code::Blocks … the compiled version of glfw3 is a ‘special’ lib-mingw version, but the GLEW is not. Just cann’t get there without knowing wtf I’m doing.

Hi all,
I followed another thread an read that GLFW3 should be initiated before GLEW. That made a difference. The shaders now compile and link to the program apparently without errors ( glGetError() ). [That was exactly what you told me Tonyo. When will I ever learn to read]
The following call to
glGenVertexArrays(1, &vao);
now seems to be a new culprit.
I have no idea why it generates a segmentation-fault.

I realize that this question no longer (ever did) apply to ‘shader language’. Bear with me.

glewExperimental = GL_TRUE ;
did the trick.

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