Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: GLUT+GLEW=OK, GLFW+GL3W=OK, but GLFW+GLEW=crash in ubuntu

  1. #1
    Intern Newbie
    Join Date
    May 2014
    Posts
    43

    GLUT+GLEW=OK, GLFW+GL3W=OK, but GLFW+GLEW=crash in ubuntu

    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:

    Code :
    glGenVertexArrays( 1, &vao );

    with the segment fault:
    Click image for larger version. 

Name:	Untitled.png 
Views:	59 
Size:	17.7 KB 
ID:	2788

    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
    Attached Files Attached Files

  2. #2
    Junior Member Newbie
    Join Date
    Jul 2011
    Location
    USA
    Posts
    24
    Quote Originally Posted by zzzhhh View Post

    Then I am thinking of GLFW+GLEW, but it crashes on ubuntu.
    I tried it and your code works just fine in Ubuntu 18.04 with Glfw and Glew. The main difference that I see from Gl3w and Glew is that Gl3w will only load the core profile functions while Glew loads everything.

  3. #3
    Intern Newbie
    Join Date
    May 2014
    Posts
    43
    @Jesse: thank you very much for trying my code. The ubuntu I am using is my institute's cluster which is 16.04. I'm afraid the IT will not upgrade to 18.04 until two years later.
    PS: you are the first to let me know that ubuntu 18.04 was released :-)

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,478
    Just to give you another data point, I tried it here on another Linux box (OpenSuSE Leap 15.0), and it worked great here as well.

    I also ran it under valgrind (memcheck) and the output was completely clean -- no flagged problems.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •