ShadowApex / godot-go

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

Not work gdnative #31

Closed yakud closed 6 years ago

yakud commented 6 years ago

Hi! I tried to add gdnative support. When I run a game have a error:

2017-12-20 22 02 28

I am set in node script dynamic lib:

2017-12-20 22 02 36

What I do wrong?

1l0 commented 6 years ago

It seems like you are working on the Godot tip that's not compatible with godot-go at this time. You could test with Godot 3.0 Beta 1 instead.

yakud commented 6 years ago

@1l0 I tried to test width Godot 3.0 Beta 1 on Mac OS X. When i am create a GDNativeLibrary have the same error:

does not have a library for the current platform

And I don't see a panel where I can set a dynamic library:

2017-12-21 11 54 21

What a godot build you use? May be I can compile godot from source?

1l0 commented 6 years ago

Try this on a terminal:

cd $GOPATH/src/github.com/ShadowApex/godot-go/examples/pong/
go build -buildmode=c-shared -o libgodot.dylib ./src/pong.go
ln -s /Applications/Godot.app/Contents/MacOS/Godot /usr/local/bin/godot
godot --version
godot Pong.tscn 
yakud commented 6 years ago

Ok, I tried to run pong example on Godot 3 RC 3.

$ godot --version
arguments
0: godot
1: --version
Current path: /Users/yakud/gamedev/godot-go/go/src/github.com/ShadowApex/godot-go/examples/pong
3.0.rc3.official

And have error:

$ godot Pong.tscn 
arguments
0: godot
1: Pong.tscn
Current path: /Users/yakud/gamedev/godot-go/go/src/github.com/ShadowApex/godot-go/examples/pong
OpenGL ES 3.0 Renderer: Intel(R) Iris(TM) Graphics 6100
GLES3: max ubo light: 409
GLES3: max ubo reflections: 455, ubo size: 144
ARVR: Registered interface: Native mobile
ERROR: open_dynamic_library: Can't open dynamic library: /Users/yakud/gamedev/godot-go/go/src/github.com/ShadowApex/godot-go/examples/pong/libgodot.dylib. Error: dlopen(/Users/yakud/gamedev/godot-go/go/src/github.com/ShadowApex/godot-go/examples/pong/libgodot.dylib, 2): Symbol not found: _godot_string_get_data
  Referenced from: /Users/yakud/gamedev/godot-go/go/src/github.com/ShadowApex/godot-go/examples/pong/libgodot.dylib
  Expected in: flat namespace
 in /Users/yakud/gamedev/godot-go/go/src/github.com/ShadowApex/godot-go/examples/pong/libgodot.dylib
   At: platform/osx/os_osx.mm:1308.
ERROR: get_symbol: No valid library handle, can't get symbol from GDNative object
   At: modules/gdnative/gdnative.cpp:315.
ERROR: init_library: No nativescript_init in "res://libgodot.dylib" found
   At: modules/gdnative/nativescript/nativescript.cpp:1053.
ERROR: terminate: No valid library handle, can't terminate GDNative object
   At: modules/gdnative/gdnative.cpp:223.

Before that I compile a dylib exactly from Makefile.

yakud commented 6 years ago

@1l0 which version godot and golang u use?

$ go version
go version go1.9.3 darwin/amd64
worrel commented 6 years ago

I hit this too with 3.0_stable and go1.9.4. It appears the string API has changed & _godot_string_get_data no longer exists. I was able to update to new methods to get Pong example to at least start.

ShadowApex commented 6 years ago

This should be resolved now with the new changes. If you have any further problems let me know. Thanks!