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

how I should compile on windows? #28

Open
MatejMagat305 opened this issue Dec 2, 2020 · 2 comments
Open

how I should compile on windows? #28

MatejMagat305 opened this issue Dec 2, 2020 · 2 comments

Comments

@MatejMagat305
Copy link

haloo I try to install this, but I can not to do it, I try many things, but still:

github.com/veandco/go-sdl2/sdl

In file included from ..\github.com\veandco\go-sdl2\sdl\audio.go:4:
./sdl_wrapper.h:2:11: fatal error: SDL2/SDL.h: No such file or directory
#include <SDL2/SDL.h>
^~~~~~~~~~~~
compilation terminated.

  • on ubuntu it run but I want for windows.........
    I am beginer, would you get some link like tutorial?
@tfriedel6
Copy link
Owner

Hi, that's a bit tricky on windows, you will have to follow the steps listed in the go-sdl2 package itself under the requirements section. https://github.com/veandco/go-sdl2/blob/master/README.md#requirements

Alternatively you can use GLFW instead of SDL if you don't actually need any SDL specific features. If you are using the sdlcanvas package, you can just replace that with the glfwcanvas package, which basically works the same way. That should just work without needing any additional stuff to be installed.

@sikora507
Copy link

Here's what I did to finally make it working because nothing else worked.

Or you can install SDL2 via Msys2 like so: pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2{,_image,_mixer,_ttf,_gfx}

Check if gcc is added to patch (it was not in my case so I've added C:\msys64\mingw64\bin myself)
Then I was able to build and run the example on Windows
image

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