Link against opengl on linux

Hello, I am trying to build my code on arch linux with an amd igpu.
exe.linkSystemLibrary("opengl32");
This works fine on windows, however on linux I get the following:

error: error: unable to find dynamic system library 'opengl32' using strategy 'paths_first'. searched paths:
  /usr/local/lib64/libopengl32.so
  /usr/local/lib64/libopengl32.a
  /usr/local/lib/libopengl32.so
  /usr/local/lib/libopengl32.a
  /usr/lib/x86_64-linux-gnu/libopengl32.so
  /usr/lib/x86_64-linux-gnu/libopengl32.a
  /lib64/libopengl32.so
  /lib64/libopengl32.a
  /lib/libopengl32.so
  /lib/libopengl32.a
  /usr/lib64/libopengl32.so
  /usr/lib64/libopengl32.a
  /usr/lib/libopengl32.so
  /usr/lib/libopengl32.a
  /lib/x86_64-linux-gnu/libopengl32.so
  /lib/x86_64-linux-gnu/libopengl32.a

I tried looking for repos which link agaist opengl but did not find anything helpful.
Any help is appreciated.

On linux the library is called just GL instead of opengl32

3 Likes

Also consider linking to and using EGL to load OpenGL instead of linking it directly. Doing this will allow for multiple OpenGL drivers to be installed at once, and for your app to select between them at runtime.

Note: libEGL is sometimes called libglvnd in distro package managers

1 Like

Thank you for your responses. Been busy with other stuff.