Closed vault-thirteen closed 1 year ago
When I try the latest unstable version, which is not yet published,
go get -v github.com/veandco/go-sdl2/sdl@master go: upgraded github.com/veandco/go-sdl2 v0.4.34 => v0.5.0-alpha.4.0.20230209044354-a8580f5a99af
it downloads some non-stable ... code and tells about other errors like:
# github.com/veandco/go-sdl2/sdl vendor\github.com\veandco\go-sdl2\sdl\pixelformatconstant_string.go:11:8: undefined: PIXELFORMAT_UNKNOWN vendor\github.com\veandco\go-sdl2\sdl\pixelformatconstant_string.go:12:8: undefined: PIXELFORMAT_INDEX1LSB vendor\github.com\veandco\go-sdl2\sdl\pixelformatconstant_string.go:13:8: undefined: PIXELFORMAT_INDEX1MSB vendor\github.com\veandco\go-sdl2\sdl\pixelformatconstant_string.go:14:8: undefined: PIXELFORMAT_INDEX4LSB vendor\github.com\veandco\go-sdl2\sdl\pixelformatconstant_string.go:15:8: undefined: PIXELFORMAT_INDEX4MSB vendor\github.com\veandco\go-sdl2\sdl\pixelformatconstant_string.go:16:8: undefined: PIXELFORMAT_INDEX8 vendor\github.com\veandco\go-sdl2\sdl\pixelformatconstant_string.go:17:8: undefined: PIXELFORMAT_RGB332 vendor\github.com\veandco\go-sdl2\sdl\pixelformatconstant_string.go:18:8: undefined: PIXELFORMAT_RGB444 vendor\github.com\veandco\go-sdl2\sdl\pixelformatconstant_string.go:57:36: undefined: PixelFormatConstant vendor\github.com\veandco\go-sdl2\sdl\pixelformatconstant_string.go:97:9: undefined: PixelFormatConstant vendor\github.com\veandco\go-sdl2\sdl\pixelformatconstant_string.go:18:8: too many errors
Compilation finished with exit code 1
Hi @vault-thirteen, thanks for reporting this issue! Could you try the updated Windows installation process in README.md? I suspect the errors were caused by go
being unable to find the MinGW tools. Updating the Path
environment variable to have the MinGW's or Cygwin's bin
directory should fix it.
Hello @veeableful. Thank you for a prompt response !
The thing is that I already had Cygwin's bin
folder in my PATH
environment variable.
I will try to re-install everything using the new instructions.
x86_64-12.2.0-release-posix-seh-msvcrt-rt_v10-rev2.7z x86_64-12.2.0-release-posix-seh-ucrt-rt_v10-rev2.7z x86_64-12.2.0-release-win32-seh-msvcrt-rt_v10-rev2.7z x86_64-12.2.0-release-win32-seh-ucrt-rt_v10-rev2.7z
Which variant of the build do I need on Windows 10 ? I guess, that POSIX is a wrong one for Windows OS, right ? MSVCRT or UCRT ?
Hi @vault-thirteen, you should be able to use any one of them I think but I used the posix ucrt. Let me know if it works for you too.
OK. Thanks.
I have found that both Windows 10 and Microsoft Visual Studio use UCRT by default, instead of an outdated MSVCRT. https://stackoverflow.com/questions/67848972/differences-between-msvcrt-ucrt-and-vcruntime-libraries
I will try this UCRT first.
https://github.com/libsdl-org/SDL/releases
SDL2-devel-2.26.5-mingw.zip SDL2-devel-2.26.5-VC.zip
Which type of SDL library do I need ? @veeableful
Hi @vault-thirteen, it should be MinGW version.
What is the difference between i686-w64
and x86_64
?
I have always thought that it is the same.
@veeableful
Hi @vault-thirteen, i686
is for 32-bit processor and x86_64
is for 64-bit processor.
Yeah, I know it, but there is a w64
postfix meaning that it is 64-bit (?) in i686-w64
.
I'm not entirely sure but I think it's just part of the MinGW name.
Looks like there is no error now. The program compiles and runs. Thank you so much ! @veeableful
No problem! I'm glad that I could help.
Go version: 1.20. Go-SDL2 version: v0.4.34. SDL2 version: 2.26.5. OS: Windows 10. Architecture: Intel x86-64.
I have installed a Cygwin64, added it's
bin
folder toPATH
environment variable. I have installed SDL and added it toPATH
variable. I have created a module and pulled a vendor folder with your library. I can even jump to thesdl.Init
function from the editor, the code is reachable. But when I run themain
function it says that it does not know about thesdl
package.P. S.
Contents of the module file:
Looks like, v0.4.34 is not working.