Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to glew #3

Open
issalig opened this issue Feb 9, 2017 · 6 comments
Open

Link to glew #3

issalig opened this issue Feb 9, 2017 · 6 comments

Comments

@issalig
Copy link

issalig commented Feb 9, 2017

On Ubuntu 16.04 I need to add a a link to libglew.

clang++ -O2 --std=c++14 pkg-config --cflags glfw3 view.cpp mymath.cpp -oview pkg-config --static --libs glfw3 glew

@vygr
Copy link
Owner

vygr commented Feb 9, 2017

Thank you.

I must upgrade my Linux test VM to 16.04 !

Regards

Chris

@issalig
Copy link
Author

issalig commented Feb 9, 2017

Also I had to call glewExperimental and glewInit in view.cpp to make it work. It seems to be sth related to my glew version (Ubuntu 16.04, GLEW version 1.13.0, OpenGL version 3.0 Mesa 11.2.0 is supported)

    glfwSetKeyCallback(window, key_callback);
    glfwSetInputMode(window, GLFW_STICKY_KEYS, 1);
   //PATCH STARTS HERE  
   //just after creating context and before using OpenGL
   //https://stackoverflow.com/questions/8302625/segmentation-fault-at-glgenvertexarrays-1-vao
   glewExperimental = GL_TRUE; 
   glewInit();
   //PATCH ENDS HERE 
    //set gl settings
    glGetError();
    glClearColor(0.0, 0.0, 0.0, 0.0);

@vygr
Copy link
Owner

vygr commented Feb 12, 2017

I've been thinking of porting over to use SDL2 rather than glfw3. I'm using that, SDL2, for other projects, and I think that would open the door to an easy Windows version of the PCB solver.

Chris

@celem
Copy link

celem commented Apr 18, 2018

Just as issalig commented on Feb 9, 2017, my compile failed on Linux version 4.14.34-1-MANJARO
I also had to add a a link to libglew.

clang++ -O2 --std=c++14 pkg-config --cflags glfw3 view.cpp mymath.cpp -oview pkg-config --static --libs glfw3 glew

@vygr
Copy link
Owner

vygr commented Apr 21, 2018

I got things to build on an Ubuntu VM after installing the libglew-dev and libglfw3-dev packages. And yes on that platforms it does SEGFAULT. So somthing to look at.

I wonder how others have managed to run it on Linux. I've never tried before myself as this was a Mac OSX project initially.

However, this makes me think I need to switch over to useing SDL rather than glfw3 as I'm not happy with glw3 even on the Mac platform.

Chris

@vygr
Copy link
Owner

vygr commented Apr 21, 2018

Adding the:

glewExperimental = GL_TRUE;
glewInit();

Does make it work.

I still think I'll switch over to SDL.

Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants