ShadowApex / godot-go

Go language bindings for the Godot Engine's GDNative API.
MIT License
363 stars 31 forks source link

Doesn't compile under windows #42

Open diocore opened 6 years ago

diocore commented 6 years ago

Description

Can't get it to work under windows. Can't compile the example in windows due to the following error: (this is with the 1.11beta2, with the normal released version in windows. the Realesed 1.10.x version get issues with the filname path to long, but this is a go win issue. Its fixed in 1.11) c:/program files/mingw-w64/x86_64-7.2.0-win32-seh-rt_v5-rev1/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large: 74588

When I cross compile it in Linux I get the following errors:

go build -buildmode=c-shared -o simple.dll FSM.go github.com/shadowapex/godot-go/vendor/github.com/vitaminwater/cgo.wchar /home/dio/.go/src/github.com/shadowapex/godot-go/vendor/github.com/vitaminwater/cgo.wchar/wchar.go:15:12: undefined: convertWcharToGoRune /home/dio/.go/src/github.com/shadowapex/godot-go/vendor/github.com/vitaminwater/cgo.wchar/wchar.go:23:9: undefined: convertGoRuneToWchar /home/dio/.go/src/github.com/shadowapex/godot-go/vendor/github.com/vitaminwater/cgo.wchar/wchar.go:47:9: undefined: convertGoStringToWcharString /home/dio/.go/src/github.com/shadowapex/godot-go/vendor/github.com/vitaminwater/cgo.wchar/wchar.go:128:14: undefined: convertWcharStringToGoString /home/dio/.go/src/github.com/shadowapex/godot-go/vendor/github.com/vitaminwater/cgo.wchar/wchar.go:141:9: undefined: convertWcharStringToGoString /home/dio/.go/src/github.com/shadowapex/godot-go/vendor/github.com/vitaminwater/cgo.wchar/wchar.go:150:9: undefined: convertWcharStringToGoString /home/dio/.go/src/github.com/shadowapex/godot-go/vendor/github.com/vitaminwater/cgo.wchar/wchar.go:158:9: undefined: convertWcharToGoRune my go env:

GOARCH="amd64" GOBIN="" GOCACHE="/home/dio/.cache/go-build" GOEXE=".exe" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="windows" GOPATH="/home/dio/.go" GORACE="" GOROOT="/usr/bin/go" GOTMPDIR="" GOTOOLDIR="/usr/bin/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="x86_64-linux-gnu-gcc" CXX="x86_64-linux-gnu-g++" CGO_ENABLED="0" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-m64 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build621006750=/tmp/go-build -gno-record-gcc-switches"

Details

Go version 1.11beta2 windows /1.10.3 linux
OS windows
vaiktorg commented 6 years ago

In my case, i can't even 'go get' the files. it throws this error: # github.com/shadowapex/godot-go/vendor/github.com/vitaminwater/cgo.wchar ..\github.com\shadowapex\godot-go\vendor\github.com\vitaminwater\cgo.wchar\convert.go:10:19: fatal error: iconv.h: No such file or directory compilation terminated.

diocore commented 6 years ago

Don't know why it says "compile" You can download it and add it manually to your GOPATH though. This is at least an easy workaround for your problem. But I guess the problem is with the compilation rather the "go get"

viktor-ferenczi commented 5 years ago

For me the error is the following:

C:\Go\bin>go get github.com/shadowapex/godot-go/godot
go build github.com/shadowapex/godot-go/godot: C:\Go\pkg\tool\windows_amd64\compile.exe: fork/exec C:\Go\pkg\tool\windows_amd64\compile.exe: The filename or extension is too long.

"The filename or extension is too long."