I have just recently made the switched for Linux to OpenBSD. So far, I am really liking the philosophy of including the bare minimum needed to run the system, and the emphasis for clean and simple code. However, I face a small problem. I am a programmer, and at the moment I am experimenting with and learning how to use the OpenGL API. Unlike Linux, however, there is no /usr/include/GL or /usr/local/include/GL. I am using the Intel graphics driver, as shown by screenfetch and dmesg. How would I install the Mesa/OpenGL API header files?

  • Did you install graphics/freeglut? – uzsolt May 1 '18 at 11:23
  • @uzsolt Yes, but that installed the freeglut headers only, not the complete GL header packages. – Safal Aryal May 1 '18 at 11:47
  • And the mesa package? – uzsolt May 1 '18 at 14:38

Please read hier(7). Xenocara (OpenBSD's Xorg) sits in /usr/X11R6. It even should have separate partition.

BSD Make tend to use mk-files. Special files in /usr/share/mk. Some of then include /usr/X11R6/share/mk. You can find X11BASE variable there to include it into your Makefile.

PS: Some people suggest /usr/local/include. Please note that OpenBSD has very clean distinction between base system and third party software.

/usr/X11R6 is part of base system. It never goes to /usr/local. But ony third party software (vim, kde, python) always goes to /usr/local/. So:

  • /usr/include: base system (except Xenocara)
  • /usr/X11R6/include: base system (Xenocara)
  • /usr/local/include: third party software.
| improve this answer | |

Try including the headers from /usr/include, /usr/X11R6/include and /usr/local/include.

| improve this answer | |

I believe that the headers you may be looking for are located in /usr/X11R6/include/GL. This where gl.h, glx.h and glu.h (and others) live on a vanilla OpenBSD system.

You may use pkg-config in your Makefile. The compiler flags needed for the standard OpenBSD Mesa are given by

pkg-config --cflags osmesa

(returns -I/usr/X11R6/include)

And likewise for GL:

pkg-config --cflags gl

(returns -I/usr/X11R6/include -I/usr/X11R6/include/libdrm)

See the pkg-config(1)manual .

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.