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

[Feature Request] Would you mind supporting MSVC besides MinGW? #358

Open chenzhekl opened 5 years ago

chenzhekl commented 5 years ago

Would you mind supporting MSVC besides MinGW?

veeableful commented 5 years ago

Hi @chenzhekl, certainly. I'll put this as one of the things to support for the next release. Seems like it would be useful for a lot of people :slightly_smiling_face:

chenzhekl commented 5 years ago

Thanks! Good to know you are considering that.

veeableful commented 5 years ago

Hi @chenzhekl, I just found out that Go itself hasn't supported MSVC out-of-the-box (seems like it is coming though according to this).

However, it seems possible to convert an existing MSVC.dll to MinGW-compatible one as shown here. Would that work for your case? If not, could I know why?

chenzhekl commented 5 years ago

@veeableful Thanks for your investigation. I want MSVC support because MSVC toolchain is used by most Windows programmers, and being able to use go-sdl2 without extra installation will be a merit. However, a MinGW compiler is still required after converting MSVC DLLs to MinGW compatible format. Probably we should wait for MSVC support to land on Go.

jclc commented 5 years ago

I don't think supporting MSVC is a priority for the Go team. It has incompatible linkage with GCC when compiling C++ and their C support is laughably bad. If you need to link with DLLs to which you don't have source code access, you could either make a C-linked wrapper for it or try Clang; apparently they added MSVC-linking recently.

gonutz commented 5 years ago

You might be interested in issue 382. If we can remove CGo on Windows, you only need a Go compiler and the SDL2.dll.