veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.21k stars 221 forks source link

'SDL_image.h' file not found #419

Closed nitrajka closed 5 years ago

nitrajka commented 5 years ago

Hi,

I installed sdl and sdl_image by these commands: brew install sdl_image brew install sdl2

Then I downloaded sdl for go: go get -v github.com/veandco/go-sdl2/sdl and go get -v github.com/veandco/go-sdl2/img

I used it in my program and got an error:

# github.com/veandco/go-sdl2/img
In file included from ../../veandco/go-sdl2/img/sdl_image.go:5:
./sdl_image_wrapper.h:5:11: fatal error: 'SDL_image.h' file not found
        #include <SDL_image.h>
                 ^~~~~~~~~~~~~
1 error generated.

Compilation finished with exit code 2

I have mac os High Sierra and go version go1.12.7 darwin/amd64. I assume I have the latest version of go_sdl2 and that is 0.3.0. Could you please help me with the error?

gen2brain commented 5 years ago

Hi,

Just use the command from README, brew install sdl2{,_image,_mixer,_ttf,_gfx} pkg-config , you installed sdl_image which is old sdl1 package.

nitrajka commented 5 years ago

That worked! I tried to rewrite the command and probably forgot the "2". Thank you very much for your answer. And sorry to bother with such a trivia.