Closed lstep closed 6 years ago
I just recently regenerated the classes using the latest Godot 3 release and pushed the change, so you might try again.
The godot_rect3_get_shortest_axis_size
function should have an implementation in the latest version of Godot. Are you using the master
branch of Godot and compiling it yourself with scons?
No, I took the "alpha2" version that was released a few days ago. I will try with the latest version.
Independently from the Godot version, if I do what is written in the README.md file (go build -v -buildmode=c-shared -o libgodot.so example.go
), and check with objdump -x
, I still get a lot of UNDefined functions (including the one Godot is complaining about):
$ objdump -x libgodot.so |grep godot|grep rect3_get_shortest_axis_size
0000000001a53cd0 l O .data 0000000000000008 github.com/shadowapex/godot-go/godot._cgo_af8ff18d68cd_Cfunc_godot_rect3_get_shortest_axis_size
0000000000763bd0 l F .text 0000000000000087 github.com/shadowapex/godot-go/godot._Cfunc_godot_rect3_get_shortest_axis_size
0000000000000000 *UND* 0000000000000000 godot_rect3_get_shortest_axis_size
0000000000c234e0 g F .text 000000000000003a _cgo_af8ff18d68cd_Cfunc_godot_rect3_get_shortest_axis_size
All this using the latest versions of Godot (2017-11-02) and your code :
I redid a go get -u github.com/shadowapex/godot-go/godot
(just to be sure :-), I also took/updated the headers from https://github.com/GodotNativeTools/godot_headers.git in my /usr/local/include directory
.
I still get Error: Apps/GODOT/projects/grad1/libgodot.so: undefined symbol: godot_rect3_get_shortest_axis_size
Hi @lstep
Those functions will always show as undefined if inspected by itself. The way godot-go works is it includes the Godot headers which just define the function signatures of all the native functions available in Godot, such as godot_rect3_get_shortest_axis_size
. When Godot loads the libgodot.so
library, it dynamically links the function signatures in godot-go to the actual implementation of the function which exists in the Godot Engine. The reason objdump
shows those methods as undefined is because you are inspecting it alone, without being loaded by Godot.
If you inspect libgodot.so
by itself, you'll see that pretty much all of the godot functions are undefined:
$ objdump -x libgodot.so | grep godot | grep -v cgo
...
0000000000000000 *UND* 0000000000000000 godot_print
0000000000000000 *UND* 0000000000000000 godot_basis_set_axis
0000000000000000 *UND* 0000000000000000 godot_array_new
0000000000000000 *UND* 0000000000000000 godot_quat_operator_neg
0000000000000000 *UND* 0000000000000000 godot_vector2_angle_to
0000000000000000 *UND* 0000000000000000 godot_variant_new_node_path
0000000000000000 *UND* 0000000000000000 godot_nativescript_register_method
0000000000000000 *UND* 0000000000000000 godot_vector2_normalized
0000000000000000 *UND* 0000000000000000 godot_basis_new_with_axis_and_angle
...
You're getting that error because the version of Godot that you're using doesn't have a definition for godot_rect3_get_shortest_axis_size
. If you use the latest version of Godot from Godot's GitHub, and compile it, it should have a definition for rect3
functions.
OK, I recompiled everything from scratch, and it works fine. I get godot.go:51: Initializing Go library.
and the debug info I put :+1:
Using even the latest nightly from http://godot3builds.digitecnology.com/index.php doesn't work.
Using the example (pong.go), made a shorter version, but when trying to run it from Godot, gives the error:
The only difference from the configuration process is that I didn't put the library as a global (as it doesn't seem to exist anymore; see #27 ) The code is used is the following:
If I check the library I generated (using latest headers from github) with objdump, I see UND for
godot_rect3_get_shortest_axis_size
: