veandco / go-sdl2

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

Strange messages from sensor #366

Closed aurimasbachanovicius closed 5 years ago

aurimasbachanovicius commented 5 years ago

After dcef35236774244fd0d2ee001ce75940d166b50b commit when building go application there appear a lot of messages:

screenshot from 2018-11-11 22-57-34

Is the only way to remove these messages is to upgrade SDL2 to 2.0.9 version?

veeableful commented 5 years ago

Hi @3auris,

As a workaround, you could go back one commit before and run go install in the sdl directory.

Otherwise, yeah. That's how it is right now. The package prints warning messages whenever you're building against older SDL2. Though, I can see why users would want it turned off. I'll consider doing some changes to it such as silent by default perhaps.

FriskyDev commented 5 years ago

The default package on Ubuntu for libsdl2-dev has not made it to 2.0.9. As a result, if you attempt to use go-sdl2 on Ubuntu, you are greeted with lots of #pragma messages.

Is there a way to just disable and make unavailable the things that are not supported, such that if you try to use them, you get an error then, instead of just for attempting to use anything in the library?

veeableful commented 5 years ago

Hi @3auris and @FriskyDev, I've disabled the warnings by default with this commit e081255f. You can see the commit message if you want to know how to re-enable it.

If people think errors is a good idea, I'll probably think about how to add that option too! For now though, I think warnings are enough.

FriskyDev commented 5 years ago

Awesome, thanks! I'll take a look as soon as I can get back to that environment. 👍

aurimasbachanovicius commented 5 years ago

For me, it's a great solution, thank you very much @veeableful

FriskyDev commented 5 years ago

This works for me. Thanks for doing this!

veeableful commented 5 years ago

Yay! I'll close this for now but let me know if there's any issue!