I'm following alone with The Cherno's youtube tutorial on OpenGL with glfw in C++, and I believe that I have written the same code that he has in one of his videos, but I am running into a problem. The code that I have provided runs, the window opens for a split second before I get
Process finished with exit code 139 (interrupted by signal 11:SIGSEGV)
Not entirely sure how to debug this either, but I had this same problem before I wrote all the shader compilation code, and just had the vertex buffer setup. I figured maybe because I didn't have a shader (this assumes my GPU didn't already imlpement one,) that maybe that was the problem. So assuming I implemented the shader correctly, that didn't fix it
unsigned int vbo;
glGenBuffers(1, &vbo);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 6, vertices, GL_STATIC_DRAW);
while (!glfwWindowShouldClose(window)) {
// code
glDrawArrays(GL_TRIANGLES, 0, 3);
// code
}
So I'm assuming the problem persists with that.
See full code under: