PDA

View Full Version : Can't compile an example (missing GL header?)



anon_lastname
10-14-2016, 03:30 PM
Hello

I am trying to build this example: https://github.com/colinstein/minimalopengl/blob/master/test.c

I have gotten it to build before, but I came back to it and had the same error again. No idea how to fix it or what changed.

My OS is ubuntu 14.04 and I'm using code::blocks

The error I get is this:

/usr/local/include/GLFW/glfw3.h|147|fatal error: GL/glcorearb.h: No such file or directory

what confuses me is that when I go to my usr/include/GL their isn't a glcorearb.h. I'm pretty sure I have all the right packages though...

thanks

GClements
10-14-2016, 03:50 PM
/usr/local/include/GLFW/glfw3.h|147|fatal error: GL/glcorearb.h: No such file or directory

FWIW, on Gentoo I have /usr/include/GL/glcorearb.h, which comes from mesa-11.0.6. It's possible that the existence of that file varies depending upon whether you're using Mesa or a proprietary OpenGL driver (e.g. nVidia's).

Also, my glfw3.h only includes that file if GLFW_INCLUDE_GLCOREARB is defined. It's possible that GLFW needs to be re-built if you change the system's OpenGL implementation.

Normally, the package manager should handle such dependencies, but the fact that your glfw3.h is in /usr/local/include suggests you built it yourself, so you'll also need to handle such interactions yourself.

anon_lastname
10-14-2016, 04:36 PM
FWIW, on Gentoo I have /usr/include/GL/glcorearb.h, which comes from mesa-11.0.6. It's possible that the existence of that file varies depending upon whether you're using Mesa or a proprietary OpenGL driver (e.g. nVidia's).

Also, my glfw3.h only includes that file if GLFW_INCLUDE_GLCOREARB is defined. It's possible that GLFW needs to be re-built if you change the system's OpenGL implementation.

Normally, the package manager should handle such dependencies, but the fact that your glfw3.h is in /usr/local/include suggests you built it yourself, so you'll also need to handle such interactions yourself.


Yes I compiled it myself, If I knew about an easier way I would have done that

Not gonna lie, I'm totally lost right now. I just ran "cmake ." and "make install" again and it didn't work

john_connor
10-15-2016, 02:26 AM
I'm totally lost right now.

here is a tutorial that helped me getting started with opengl on linux (SDL2, GLEW, codeblocks)
https://www.youtube.com/watch?v=ftiKrP3gW3k&list=PLEETnX-uPtBXT9T-hD0Bj31DSnwio-ywh

anon_lastname
10-15-2016, 09:01 AM
here is a tutorial that helped me getting started with opengl on linux (SDL2, GLEW, codeblocks)
https://www.youtube.com/watch?v=ftiKrP3gW3k&list=PLEETnX-uPtBXT9T-hD0Bj31DSnwio-ywh

Thanks

What I ended up doing to fix it was just copying the header into my GL directory with gksudo [how I feel right now: :doh::doh::doh::doh:]