Closed dpeckham closed 5 years ago
Wow that is strange. Could it be somehow using newer SDL2 headers but linking to outdated SDL2 libraries? Did you install a custom version of SDL2?
I installed on my own Ubuntu 18.10 and it seems to work.
I've got it working on another distro (Arch) for now. Closing...
This simple test program won't compile... other go "hello world" apps are working, and C SDL2 examples are working. This won't.
main.go:
func main() { if err := sdl.Init(sdl.INIT_EVERYTHING); err != nil { panic(err) } defer sdl.Quit() }
$ go build main.go
command-line-arguments
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1 /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function
_cgo_9ed60ab90e3e_Cfunc_SDL_NumSensors': /tmp/go-build/cgo-gcc-prolog:43: undefined reference to
SDL_NumSensors' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorFromInstanceID': /tmp/go-build/cgo-gcc-prolog:62: undefined reference to
SDL_SensorFromInstanceID' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorGetData': /tmp/go-build/cgo-gcc-prolog:84: undefined reference to
SDL_SensorGetData' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorGetDeviceInstanceID': /tmp/go-build/cgo-gcc-prolog:104: undefined reference to
SDL_SensorGetDeviceInstanceID' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorGetDeviceName': /tmp/go-build/cgo-gcc-prolog:123: undefined reference to
SDL_SensorGetDeviceName' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorGetDeviceNonPortableType': /tmp/go-build/cgo-gcc-prolog:143: undefined reference to
SDL_SensorGetDeviceNonPortableType' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorGetDeviceType': /tmp/go-build/cgo-gcc-prolog:163: undefined reference to
SDL_SensorGetDeviceType' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorGetInstanceID': /tmp/go-build/cgo-gcc-prolog:182: undefined reference to
SDL_SensorGetInstanceID' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorGetName': /tmp/go-build/cgo-gcc-prolog:200: undefined reference to
SDL_SensorGetName' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorGetNonPortableType': /tmp/go-build/cgo-gcc-prolog:219: undefined reference to
SDL_SensorGetNonPortableType' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorGetType': /tmp/go-build/cgo-gcc-prolog:238: undefined reference to
SDL_SensorGetType' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorOpen': /tmp/go-build/cgo-gcc-prolog:257: undefined reference to
SDL_SensorOpen' /usr/bin/ld: /tmp/go-link-683652254/000028.o: in function_cgo_9ed60ab90e3e_Cfunc_SDL_SensorUpdate': /tmp/go-build/cgo-gcc-prolog:272: undefined reference to
SDL_SensorUpdate' collect2: error: ld returned 1 exit status$ apt list | grep sdl | grep installed
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libsdl2-2.0-0/cosmic,now 2.0.8+dfsg1-4ubuntu1 amd64 [installed] libsdl2-dev/cosmic,now 2.0.8+dfsg1-4ubuntu1 amd64 [installed] libsdl2-gfx-1.0-0/cosmic,now 1.0.4+dfsg-1 amd64 [installed,automatic] libsdl2-gfx-dev/cosmic,now 1.0.4+dfsg-1 amd64 [installed] libsdl2-image-2.0-0/cosmic,now 2.0.3+dfsg1-1 amd64 [installed,automatic] libsdl2-image-dev/cosmic,now 2.0.3+dfsg1-1 amd64 [installed] libsdl2-mixer-2.0-0/cosmic,now 2.0.2+dfsg1-2 amd64 [installed] libsdl2-mixer-dev/cosmic,now 2.0.2+dfsg1-2 amd64 [installed] libsdl2-net-2.0-0/cosmic,now 2.0.1+dfsg1-3 amd64 [installed] libsdl2-net-dev/cosmic,now 2.0.1+dfsg1-3 amd64 [installed] libsdl2-ttf-2.0-0/cosmic,now 2.0.14+dfsg1-2 amd64 [installed] libsdl2-ttf-dev/cosmic,now 2.0.14+dfsg1-2 amd64 [installed]
Ubuntu Linux uname -a Linux dave-linux 4.18.0-13-generic #14-Ubuntu SMP Wed Dec 5 09:04:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux