Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL2_framerate.h not such file or directory #565

Open
piotao opened this issue Apr 12, 2023 · 4 comments
Open

SDL2_framerate.h not such file or directory #565

piotao opened this issue Apr 12, 2023 · 4 comments

Comments

@piotao
Copy link

piotao commented Apr 12, 2023

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

  1. Write a simple program for SDL2 testing (attached main.go in zip)
  2. go get github.com/veandco/go-sdl2/sdl (no errors)
  3. go get github.com/veandco/go-sdl2/gfx (no errors)
  4. 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:

  1. 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.
  2. Changed file is included.
  3. This worked, and now I have graphics window which draws lines. I assume this fix is working! :) File is included in zip file too.

files.zip

@veeableful
Copy link
Contributor

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?

@hfiguiere
Copy link

Shouldn't this be pkg-config --cflags SDL2_gfx in that case?

@hfiguiere
Copy link

SDL2_framerate.h comes with SDL2_gfx so that's the package that should be checked for that header.

@veeableful
Copy link
Contributor

Hi @hfiguiere, thank you for the suggestion. I have updated the pkg-config to use sdl2_gfx in the v0.4.39 tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants