tfriedel6 / canvas

Canvas is a Go drawing library based on OpenGL or using software rendering that is very similar to the HTML5 canvas API
BSD 3-Clause "New" or "Revised" License
506 stars 41 forks source link

how I should compile on windows? #28

Open MatejMagat305 opened 3 years ago

MatejMagat305 commented 3 years ago

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.

tfriedel6 commented 3 years ago

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 commented 2 years ago

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