go-gl/gl

getting error Package gl was not found in the pkg-config search path.

Closed this issue · 1 comments

When i try to run any gl code i get this error

`Package gl was not found in the pkg-config search path.
Perhaps you should add the directory containing gl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gl' found
Package gl was not found in the pkg-config search path.
Perhaps you should add the directory containing gl.pc'
to the PKG_CONFIG_PATH environment variable
No package gl' found
pkg-config: exit status 1

github.com/go-gl/glfw/v3.2/glfw

In file included from ./glfw/src/internal.h:169,
from ./glfw/src/context.c:28,
from ../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20221017161538-93cebf72946b/v3.2/glfw/c_glfw.go:4:
./glfw/src/x11_platform.h:36:10: fatal error: X11/Xlib.h: No such file or directory
36 | #include <X11/Xlib.h>
| ^~~~~~~~~~~~
compilation terminated.
`

I'm on a linux machine, don't know if that's relevant or not

Found out what the problem was.

If you're facing the same problem on a ubuntu/debian machine try running:

sudo apt-get install xorg-dev
sudo apt-get install build-essentials (installs gcc)
sudo apt-get install libgl1-mesa-dev

these are essential for using go-gl on a ubuntu/debian machine.