charmbracelet / harmonica

A simple, physics-based animation library 🎼
MIT License
1.06k stars 22 forks source link

issue running an example #13

Open rockey5520 opened 2 years ago

rockey5520 commented 2 years ago

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.
muesli commented 2 years ago

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

rockey5520 commented 2 years ago

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.
muesli commented 2 years ago

Try installing the development headers as well:

sudo apt install libgl1-mesa-dev xorg-dev
rockey5520 commented 2 years ago

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