The code in red book for OpenGL 4.3 is GLUT(freeglut actually)+GLEW, which runs ok.
The code in red book for OpenGL 4.5 is GLFW+GL3W, which runs ok too.
Then I am thinking of GLFW+GLEW, but it crashes on ubuntu. The source code is the Sierpinski Gasket from a computer graphics textbook (it’s highly likely familiar to you already). The zip package of the sources is in the attachment. I build it in NetBeans 8.2 on ubuntu 16.04 in which OpenGL 4.5 is installed. The linking option is -lglfw -lGLEW -lGL -ldl. The original GLUT statements (which works with GLEW) are commented out and GLFW codes are added in. The crash happens at line 35 of the main source example1.cpp:
glGenVertexArrays( 1, &vao );
with the segment fault:
I don’t know where I made a mistake or missed something after checking many times, so I submit the problem here in hope that someone could help. If you need any information towards troubleshooting, please let me know. Thank you!
PS: GLFW+GLEW works on Windows 10 + Visual Studio 2015