harmonica icon indicating copy to clipboard operation
harmonica copied to clipboard

issue running an example

Open rockey5520 opened this issue 2 years ago • 4 comments

when attempted to run example provided at https://github.com/charmbracelet/harmonica/blob/master/examples/spring/opengl/main.go returns error as below. wondering if am missing to install any package ?

(base) ➜  temp go run main.go
# pkg-config --cflags  -- gl gl
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.3/glfw
vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw.go:4:10: fatal error: glfw/src/context.c: No such file or directory
    4 | #include "glfw/src/context.c"
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

rockey5520 avatar Jun 22 '22 15:06 rockey5520

This example requires mesa or any other package that provides an OpenGL implementation to be installed on your system.

muesli avatar Jun 22 '22 15:06 muesli

Thanks, I did installed mesa and still get the same error

i used following installation instructions : https://www.linuxcapable.com/install-upgrade-mesa-drivers-radeon-nvidia-on-ubuntu-20-04-lts/

(base) ➜  temp glxinfo | grep "OpenGL version"
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.1.2 - kisak-mesa PPA
(base) ➜  temp go run main.go                 
# pkg-config --cflags  -- gl gl
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.3/glfw
vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw.go:4:10: fatal error: glfw/src/context.c: No such file or directory
    4 | #include "glfw/src/context.c"
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

rockey5520 avatar Jun 22 '22 16:06 rockey5520

Try installing the development headers as well:

sudo apt install libgl1-mesa-dev xorg-dev

muesli avatar Jun 22 '22 16:06 muesli

tried but error message remains same :) if i give you any other info about my systems would help ?

rockey5520 avatar Jun 22 '22 16:06 rockey5520