go-sdl2
go-sdl2 copied to clipboard
SDL2_framerate.h not such file or directory
System: MX Linux 21 SDL2 installed and files in /usr/include/SDL2 exists (see attached file with ls -R - zipped)
Steps to reproduce in $HOME/go/src/esdeel directory: 0. go mod init
- Write a simple program for SDL2 testing (attached main.go in zip)
- go get github.com/veandco/go-sdl2/sdl (no errors)
- go get github.com/veandco/go-sdl2/gfx (no errors)
- go build (or go run, doesn't matter)
Error: esdeel$ go build .
github.com/veandco/go-sdl2/gfx
In file included from ../../pkg/mod/github.com/veandco/[email protected]/gfx/sdl_gfx.go:5: ./sdl_gfx_wrapper.h:8:11: fatal error: SDL2_framerate.h: No such file or directory 8 | #include <SDL2_framerate.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated.
HOW I FIXED THAT:
- Opened file ~/go/pkg/mod/github.com/veandco/[email protected]/gfx/sdl_gfx_wrapper.h and manually changed linux includes from default <SDL2_framerate.h> to their direct paths: #include "/usr/include/SDL2/SDL2_framerate.h" etc.
- Changed file is included.
- This worked, and now I have graphics window which draws lines. I assume this fix is working! :) File is included in zip file too.
Hi @piotao, we rely on pkg-config --cflags sdl2 to find the SDL2 include directory. I wonder if MX Linux doesn't provide it or SDL2's pkgconfig directory is not in PKG_CONFIG_PATH environment variable?
Shouldn't this be pkg-config --cflags SDL2_gfx in that case?
SDL2_framerate.h comes with SDL2_gfx so that's the package that should be checked for that header.
Hi @hfiguiere, thank you for the suggestion. I have updated the pkg-config to use sdl2_gfx in the v0.4.39 tag.