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

Compile broken with old SDL? #496

Open
shish opened this issue Oct 10, 2021 · 11 comments
Open

Compile broken with old SDL? #496

shish opened this issue Oct 10, 2021 · 11 comments

Comments

@shish
Copy link

shish commented Oct 10, 2021

Trying to build inside github actions, where the current version of SDL is 2.0.8

| /root/go/src/github.com/veandco/go-sdl2/sdl/render.go:330:14: could not determine kind of name for C.GoString
| /root/go/src/github.com/veandco/go-sdl2/sdl/render.go:865:3: could not determine kind of name for C.RenderCopy
| /root/go/src/github.com/veandco/go-sdl2/sdl/render.go:354:14: could not determine kind of name for C.SDL_CreateRenderer
[...]
| gcc errors for preamble:
| /root/go/src/github.com/veandco/go-sdl2/sdl/render.go: In function 'SDL_LockTextureToSurface':
| /root/go/src/github.com/veandco/go-sdl2/sdl/render.go:204:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
|  {
|  ^
| /root/go/src/github.com/veandco/go-sdl2/sdl/render.go:213:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
|  {
|  ^
| cgo-generated-wrapper:1:0: error: expected '{' at end of input

It looks to my eyes like the SDL_LockTextureToSurface stub for pre-2.0.12 versions is missing a body?

static int SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface)

@veeableful
Copy link
Contributor

Thanks, @shish for reporting the issue! I have pushed the fix to master and v0.4.x branches.

@AXDOOMER
Copy link

Also broken with SDL 2.0.10.

../../go/pkg/mod/github.com/veandco/[email protected]/sdl/timer.go:22:16: could not determine kind of name for C.SDL_GetTicks64

Since this commit: 06f44fa

This function is only available in SDL 2.0.18.

@veeableful
Copy link
Contributor

Hi @AXDOOMER, thanks for reporting the issue! I have fixed it in the latest tag release v0.4.16.

@shish
Copy link
Author

shish commented Aug 1, 2022

Looks like another one just appeared

../../../go/src/github.com/veandco/go-sdl2/sdl/log.go:55:18: could not determine kind of name for C.SDL_LogCategory

Using latest go-sdl2 and libsdl 2.0.10

Example of a build that was working a couple of days ago and not today: https://github.com/shish/rosettaboy/runs/7602639263

@veeableful
Copy link
Contributor

Hi @shish, did it really use the latest go-sdl2 which is v0.4.24? The go.sum seems to suggest that it's using v0.4.10.

@shish
Copy link
Author

shish commented Aug 1, 2022

Looks like I was actually ignoring go.sum because my github actions script installed the latest go-sdl from the main branch before it even checks out my project code ^^;

(I am not a go expert, I don't even know how to install specific versions of things >.>)

@shish
Copy link
Author

shish commented Aug 1, 2022

Bumping go.sum to use v0.4.24 also seems to hit the same error

@shish
Copy link
Author

shish commented Aug 1, 2022

Actually, this happens before even getting to my code at all - just taking a fresh github actions VM, running sudo apt-get update && sudo apt-get install -y golang libsdl2-dev + go get github.com/veandco/go-sdl2/sdl

@veeableful
Copy link
Contributor

Hi @shish , it seems like the container is using Go provided by Ubuntu 18.04 which is relatively old at v1.10. Could you use newer Go, at least v1.13? Since we are using Go modules now, the minimum Go version has been bumped to v1.13.

@shish
Copy link
Author

shish commented Aug 2, 2022

I'm not sure where you're seeing ubuntu-18.04 / golang 1.10 -- I was using the ubuntu-20.04 base with golang 1.13 :S (See the "install deps" logs in https://github.com/shish/rosettaboy/runs/7602639263?check_suite_focus=true )

However, using the "ubuntu-22.04 beta" container with golang 1.18 + libsdl2 2.0.20 appears to work, so that's enough for me :)

@veeableful
Copy link
Contributor

Oh I'm sorry, I must have confused it with another new issue which has the same issue as yours and same way of using Ubuntu's Go package. It seems like it might not only be the Go version issue as our Github Actions for v0.4.x have been building fine with Go 1.13 though it's using latest Ubuntu. I will see if I can make it work with Ubuntu 20.04 as well if there's truly an issue with it somewhere.

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