Menu

#234 problem with running a compiled program Segmentation fault: 11 on mac os el capitan

None
closed-invalid
nobody
None
5
2016-11-03
2016-11-02
No

basically I am following the tutorial here after hours of search I released that I can install freeglut, glew and glfw3 using brew. and then by adding /usr/local/Cellar to the end of /etc/paths and using the command line like below: g++ -framework OpenGL foo.c -lGLEW -lglfw3 lGLUT or g++ -framework OpenGL -framework GLUT foo.c -lGLEW -lglfw3 I can get the code compiled. however when I run the compiled program it stopes with a stake overflow error Segmentation fault: 11 you may see the complete error report in the attachment.

1 Attachments

Discussion

  • Foad S. Farimani

    well I figiured part of the problem out apparantly by using

    glewExperimental = GL_TRUE;
    

    right before

    glewInit();
    

    the problems gets solved. I learned it from here.

    however I have another error when runing:

    Vertex shader not compiled.
    InfoLog:
    ERROR: 0:3: '' :  version '130' is not supported
    
    Fragment shader not compiled.
    InfoLog:
    ERROR: 0:3: '' :  version '130' is not supported
    ERROR: 0:23: 'precision' : syntax error: syntax error
    

    don't know how to solve it!

     
  • John Tsiombikas

    John Tsiombikas - 2016-11-03
    • status: open --> closed-invalid
    • Group: -->
     
  • John Tsiombikas

    John Tsiombikas - 2016-11-03

    You are not using freeglut. You are using Apple's implementation of GLUT. Also none of your problems have anything to do with either.

     
  • Foad S. Farimani

    @John, thanks for your reply, yes I had already gueesed that. so would you be so kind to help me find the right command to compile my code? it must be something like this:

    g++ -framework OpenGL foo.c -lGLEW -lglfw3 -lfreglut
    
     

    Last edit: Foad S. Farimani 2016-11-03
  • Foad S. Farimani

    it seems that I'm not the only one who doesn't know how to use freeglut instead of main mac glut. you may see here and here they have all got it wrong apparantly!

     

Log in to post a comment.