Comments (10)
I think this is a problem with your installation of your tools.
When you have installed Go and MinGW correctly, you should be able to compile and run the following program just fine.
package main
//#include <stdlib.h>
import "C"
func main() {
data := C.malloc(4)
C.free(data)
}
from go-sdl2.
Yep, it works well, but when i try to compile a game with sdl it doesn't work
C:\Users\HaCk3D\Desktop\Game>go build main2.go
C:\Users\HaCk3D\Desktop\Game>main2.exe
C:\Users\HaCk3D\Desktop\Game>go build main.go
# github.com/veandco/go-sdl2/sdl
could not determine kind of name for C.free
Don't u know why?
And one more: i've tried first to crosscompile it, but it shows
$ GOARCH=amd64 GOOS=windows CGO_ENABLED=1 go build main.go
# runtime/cgo
gcc: error: unrecognized command line option ‘-mthreads’
Googled it, but no answers at all. Even cant find any info bout "-mthreads" flag
from go-sdl2.
Whats the difference between main2.go and main.go?
Are you sure that you have a clean version of this library?
Does go build github.com/veandco/go-sdl2/sdl
work?
Can you run the examples/events.go ?
Cross-compiling with cgo is a little tricky, I haven't done it in a while because it was too much of a bother the first time. I'm not very familar with it, but at the very least you have to make sure it calls a cross-compiling version of gcc instead of the regular gcc. mthreads
from go-sdl2.
main.go is my game, main2.go is ur source
ive installed it like on linux go get ithub.com/veandco/go-sdl2/sdl
go build github.com/veandco/go-sdl2/sdl
# github.com/veandco/go-sdl2/sdl
could not determine kind of name for C.free
So i cant try examples :C
Thnx a lot, btw dont u know how to define a mingw cross-compiler?
coz i have 3 of them
/usr/lib/gcc $ ls
i686-w64-mingw32/
x86_64-unknown-linux-gnu/
x86_64-w64-mingw32/
When i try to use cc, it show the mthreads error again
GOARCH=amd64 GOOS=windows CGO_ENABLED=1 CC=cc go build main.go
from go-sdl2.
I still can't really tell where the error you're having is coming from...
It still seems like it isn't importing stdlib.h ...
So if you take a clean copy of go-sdl2 and add
#include <stdlib.h>
to the end of the file go-sdl2/sdl/sdl_wrapper.h
,
does it change go build github.com/veandco/go-sdl2/sdl
?
As for the cross-compilation, you'd be better off finding somebody familiar with it, try golang-nuts.
from go-sdl2.
omg, added #include <stdlib.h>
to go-sdl2/sdl/sdl_wrapper.h
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:168: undefined reference t
o `SDL_GL_LoadLibrary'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GL_MakeCurrent':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:182: undefined reference t
o `SDL_GL_MakeCurrent'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GL_SetAttribute':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:196: undefined reference t
o `SDL_GL_SetAttribute'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GL_SetSwapInterva
l':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:209: undefined reference t
o `SDL_GL_SetSwapInterval'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetClosestDisplay
Mode':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:242: undefined reference t
o `SDL_GetClosestDisplayMode'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetCurrentDisplay
Mode':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:256: undefined reference t
o `SDL_GetCurrentDisplayMode'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetCurrentVideoDr
iver':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:268: undefined reference t
o `SDL_GetCurrentVideoDriver'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetDesktopDisplay
Mode':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:282: undefined reference t
o `SDL_GetDesktopDisplayMode'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetDisplayBounds'
:
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:296: undefined reference t
o `SDL_GetDisplayBounds'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetDisplayMode':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:311: undefined reference t
o `SDL_GetDisplayMode'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetNumDisplayMode
s':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:324: undefined reference t
o `SDL_GetNumDisplayModes'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetNumVideoDispla
ys':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:336: undefined reference t
o `SDL_GetNumVideoDisplays'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetNumVideoDriver
s':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:348: undefined reference t
o `SDL_GetNumVideoDrivers'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetVideoDriver':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:361: undefined reference t
o `SDL_GetVideoDriver'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowBrightne
ss':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:374: undefined reference t
o `SDL_GetWindowBrightness'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowData':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:388: undefined reference t
o `SDL_GetWindowData'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowDisplayI
ndex':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:401: undefined reference t
o `SDL_GetWindowDisplayIndex'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowDisplayM
ode':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:415: undefined reference t
o `SDL_GetWindowDisplayMode'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowFlags':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:428: undefined reference t
o `SDL_GetWindowFlags'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowFromID':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:441: undefined reference t
o `SDL_GetWindowFromID'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowGammaRam
p':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:457: undefined reference t
o `SDL_GetWindowGammaRamp'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowGrab':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:470: undefined reference t
o `SDL_GetWindowGrab'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowID':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:483: undefined reference t
o `SDL_GetWindowID'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowMaximumS
ize':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:496: undefined reference t
o `SDL_GetWindowMaximumSize'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowMinimumS
ize':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:507: undefined reference t
o `SDL_GetWindowMinimumSize'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowPixelFor
mat':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:518: undefined reference t
o `SDL_GetWindowPixelFormat'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowPosition
':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:531: undefined reference t
o `SDL_GetWindowPosition'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowSize':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:542: undefined reference t
o `SDL_GetWindowSize'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowSurface'
:
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:553: undefined reference t
o `SDL_GetWindowSurface'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GetWindowTitle':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:566: undefined reference t
o `SDL_GetWindowTitle'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_IsScreenSaverEnab
led':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:587: undefined reference t
o `SDL_IsScreenSaverEnabled'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowBordered
':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:635: undefined reference t
o `SDL_SetWindowBordered'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowBrightne
ss':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:647: undefined reference t
o `SDL_SetWindowBrightness'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowData':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:662: undefined reference t
o `SDL_SetWindowData'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowDisplayM
ode':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:676: undefined reference t
o `SDL_SetWindowDisplayMode'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowFullscre
en':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:690: undefined reference t
o `SDL_SetWindowFullscreen'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowGammaRam
p':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:706: undefined reference t
o `SDL_SetWindowGammaRamp'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowGrab':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:718: undefined reference t
o `SDL_SetWindowGrab'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowIcon':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:728: undefined reference t
o `SDL_SetWindowIcon'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowMaximumS
ize':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:739: undefined reference t
o `SDL_SetWindowMaximumSize'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowMinimumS
ize':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:750: undefined reference t
o `SDL_SetWindowMinimumSize'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowPosition
':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:761: undefined reference t
o `SDL_SetWindowPosition'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowSize':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:772: undefined reference t
o `SDL_SetWindowSize'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_SetWindowTitle':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:782: undefined reference t
o `SDL_SetWindowTitle'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_UpdateWindowSurfa
ce':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:802: undefined reference t
o `SDL_UpdateWindowSurface'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_UpdateWindowSurfa
ceRects':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:817: undefined reference t
o `SDL_UpdateWindowSurfaceRects'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_VideoInit':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:830: undefined reference t
o `SDL_VideoInit'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_DestroyWindow':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:65: undefined reference to
`SDL_DestroyWindow'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_DisableScreenSave
r':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:74: undefined reference to
`SDL_DisableScreenSaver'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_EnableScreenSaver
':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:83: undefined reference to
`SDL_EnableScreenSaver'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GL_DeleteContext'
:
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:105: undefined reference t
o `SDL_GL_DeleteContext'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GL_SwapWindow':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:220: undefined reference t
o `SDL_GL_SwapWindow'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_GL_UnloadLibrary'
:
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:229: undefined reference t
o `SDL_GL_UnloadLibrary'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_HideWindow':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:577: undefined reference t
o `SDL_HideWindow'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_MaximizeWindow':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:598: undefined reference t
o `SDL_MaximizeWindow'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_MinimizeWindow':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:607: undefined reference t
o `SDL_MinimizeWindow'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_RaiseWindow':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:616: undefined reference t
o `SDL_RaiseWindow'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_RestoreWindow':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:625: undefined reference t
o `SDL_RestoreWindow'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_ShowWindow':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:791: undefined reference t
o `SDL_ShowWindow'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\video.cgo2.o: In function `cgo_465306a7af4d_Cfunc_SDL_VideoQuit':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/video.go:841: undefined reference t
o `SDL_VideoQuit'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\events.o: In function `setEventFilter':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/events.c:6: undefined reference to
`SDL_SetEventFilter'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\events.o: In function `clearEventFilter':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/events.c:11: undefined reference to
`SDL_SetEventFilter'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\events.o: In function `filterEvents':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/events.c:16: undefined reference to
`SDL_FilterEvents'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\events.o: In function `addEventWatch':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/events.c:21: undefined reference to
`SDL_AddEventWatch'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\events.o: In function `delEventWatch':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/events.c:26: undefined reference to
`SDL_DelEventWatch'
C:\Users\HaCk3D\AppData\Local\Temp\go-build623479747\github.com\veandco\go-sdl2\
sdl\_obj\log.o: In function `LogSetOutputFunction':
C:/UserGo/src/github.com/veandco/go-sdl2/sdl/log.c:5: undefined reference to `SD
L_LogSetOutputFunction'
collect2.exe: error: ld returned 1 exit status
from go-sdl2.
That's pretty telling, I believe that this is the result of not having SDL2 installed correctly (for MinGW that is).
I still can't quite reproduce your output, but you could try re-copying the *.a files for SDL2 to mingw's lib folder (making sure to use the 32-bit version if you're still using 32-bit mingw & go).
As a more general course of action, try to get a simple C sdl program working.
from go-sdl2.
Thnx a lot, it turned out that crosscompiling is much easier then compiling on win :D
Plz, close the issue.
from go-sdl2.
@HaCk3Dq In case you want to try setting go-sdl2 up on Windows again, I put together a step-by-step guide here: https://gist.github.com/Decker108/7df1726192433a3bdb32
from go-sdl2.
You might be interested in issue 382. If we can remove CGo on Windows, you only need a Go compiler and the SDL2.dll
.
from go-sdl2.
Related Issues (20)
- WASI Support
- Not compatible with Go 1.21.0 HOT 7
- SDL/SDL.h: No such file or directory HOT 2
- How to ship release version HOT 4
- Surface panics on color conversions due to nonidiomatic color models HOT 4
- Windows release crashing likely because C.CString deallocated with C.SDL_free HOT 3
- Getting an errror when compiling to wasm HOT 2
- impossible type switch case: sdl.QuitEvent HOT 4
- Cannot find -lsdl2 HOT 10
- SDL_AudioStreamAvailable not correctly wrapped HOT 2
- Missing functions in gamecontroller.go HOT 6
- Readme Example Fix typo HOT 2
- Running readme example yields 30% CPU usage HOT 13
- Fails to link with musl libc HOT 1
- feature req: img.LoadSizedSVG HOT 2
- SdlSetTextureScaleMode HOT 7
- Window Doesn't Show HOT 9
- How to SDL on 64bit Windows Instructions Unclear HOT 1
- (suggestion) Convert sdl.Rect Fields from int32 to int HOT 4
- pkg-config issue with sdl2_gfx 0.4.35->0.4.39 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-sdl2.