godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.68k stars 509 forks source link

Can't compile latest godot-cpp #120

Closed thankjura closed 6 years ago

thankjura commented 6 years ago

Godot version 3.1.dev.custom_build.a1f835d

make linux64 USE_CLANG=yes REGENERATE_BINDINGS=yes GODOT_BIN_PATH=/usr/bin/godot.x11.tools.64.llvm scons n=godot-cpp use_llvm=yes regenerate_bindings=yes target=debug headers=../godot_headers godotbinpath=/usr/bin/godot.x11.tools.64.llvm -j4 p=linux a=64 scons: Reading SConscript files ... OpenGL ES 3.0 Renderer: GeForce GTX 1070/PCIe/SSE2 scons: done reading SConscript files. scons: Building targets ... clang++ -o src/core/Dictionary.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot_headers -Iinclude -Iinclude/gen -Iinclude/core src/core/Dictionary.cpp clang++ -o src/core/GodotGlobal.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot_headers -Iinclude -Iinclude/gen -Iinclude/core src/core/GodotGlobal.cpp clang++ -o src/core/Array.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot_headers -Iinclude -Iinclude/gen -Iinclude/core src/core/Array.cpp clang++ -o src/core/PoolArrays.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot_headers -Iinclude -Iinclude/gen -Iinclude/core src/core/PoolArrays.cpp src/core/GodotGlobal.cpp:114:46: error: assigning to 'void ()(void , godot_object )' (aka 'void ()(void , void )') from incompatible type 'void (void , const void , godot_object ) attribute((sysv_abi))' (aka 'void (void , const void , void )'): different number of parameters (2 vs 3) binding_funcs.alloc_instance_binding_data = wrapper_create; ^~~~~~ 1 error generated. scons: [src/core/GodotGlobal.o] Error 1 scons: building terminated because of errors. make: [Makefile:28: linux64] Ошибка 2

karroffel commented 6 years ago

Make sure to use the latest Godot master build, if you compile from the latest nativescript-1.1 branch then you need to apply this PR https://github.com/godotengine/godot/pull/17980, it changes the headers a bit, so you will need to point those to the Godot repo as well.

thankjura commented 6 years ago

Hm. I apply this patch, but have same error https://patch-diff.githubusercontent.com/raw/godotengine/godot/pull/17980.patch

make linux64 USE_CLANG=yes REGENERATE_BINDINGS=yes GODOT_BIN_PATH=/usr/bin/godot.x11.tools.64.llvm scons n=godot-cpp use_llvm=yes regenerate_bindings=yes target=debug headers=../godot_headers godotbinpath=/usr/bin/godot.x11.tools.64.llvm -j4 p=linux a=64 scons: Reading SConscript files ... OpenGL ES 3.0 Renderer: GeForce GTX 1070/PCIe/SSE2 scons: done reading SConscript files. scons: Building targets ... clang++ -o src/core/GodotGlobal.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot_headers -Iinclude -Iinclude/gen -Iinclude/core src/core/GodotGlobal.cpp clang++ -o src/core/TagDB.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot_headers -Iinclude -Iinclude/gen -Iinclude/core src/core/TagDB.cpp clang++ -o src/core/Basis.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot_headers -Iinclude -Iinclude/gen -Iinclude/core src/core/Basis.cpp clang++ -o src/core/Transform2D.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot_headers -Iinclude -Iinclude/gen -Iinclude/core src/core/Transform2D.cpp src/core/GodotGlobal.cpp:114:46: error: assigning to 'void ()(void , godot_object )' (aka 'void ()(void , void )') from incompatible type 'void (void , const void , godot_object ) attribute((sysv_abi))' (aka 'void (void , const void , void )'): different number of parameters (2 vs 3) binding_funcs.alloc_instance_binding_data = wrapper_create; ^~~~~~ 1 error generated. scons: *** [src/core/GodotGlobal.o] Error 1 src/core/TagDB.cpp:21:31: error: no member named 'godot_nativescript_set_global_type_tag' in 'godot_gdnative_ext_nativescript_1_1_api_struct' godot::nativescript_1_1_api->godot_nativescript_set_global_type_tag(godot::_RegisterState::language_index, name, type_tag);


1 error generated.
scons: *** [src/core/TagDB.o] Error 1
scons: building terminated because of errors.
make: *** [Makefile:28: linux64] Ошибка 2
karroffel commented 6 years ago

You didn't set the path to the new header files.

The build command should be make linux64 USE_CLANG=yes HEADERS=../../Godot/master/modules/gdnative/include REGENERATE_BINDINGS=yes GODOT_BIN_PATH=/usr/bin/godot.x11.tools.64.llvm or similar.

Notice the HEADERS=../../Godot/master/modules/gdnative/include. The godot_headers repo doens't have the correct headers for this, the ones from inside Godot itself have to be used until the PR is merged and the headers repository updated

thankjura commented 6 years ago

scons n=godot-cpp use_llvm=yes regenerate_bindings=yes target=debug headers=../godot-engine/modules/gdnative/include godotbinpath=/usr/bin/godot.x11.tools.64.llvm -j4 p=linux a=64 scons: Reading SConscript files ... OpenGL ES 3.0 Renderer: GeForce GTX 1070/PCIe/SSE2 scons: done reading SConscript files. scons: Building targets ... clang++ -o src/core/TagDB.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot-engine/modules/gdnative/include -Iinclude -Iinclude/gen -Iinclude/core src/core/TagDB.cpp clang++ -o src/gen/Curve.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot-engine/modules/gdnative/include -Iinclude -Iinclude/gen -Iinclude/core src/gen/Curve.cpp clang++ -o src/gen/VisualScriptPreload.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot-engine/modules/gdnative/include -Iinclude -Iinclude/gen -Iinclude/core src/gen/VisualScriptPreload.cpp clang++ -o src/gen/VideoStreamWebm.o -c -fPIC -g -O3 -std=c++14 -Wwrite-strings -m64 -I. -I/home/GrandMaster/Development/games/godot-engine/modules/gdnative/include -Iinclude -Iinclude/gen -Iinclude/core src/gen/VideoStreamWebm.cpp src/core/TagDB.cpp:21:31: error: no member named 'godot_nativescript_set_global_type_tag' in 'godot_gdnative_ext_nativescript_1_1_api_struct' godot::nativescript_1_1_api->godot_nativescript_set_global_type_tag(godot::_RegisterState::language_index, name, type_tag);


1 error generated.
scons: *** [src/core/TagDB.o] Error 1
scons: building terminated because of errors.
make: *** [Makefile:29: linux64] Ошибка 2

ok. I wait to be PR merged into master ;)

thankjura commented 6 years ago

Rebuild from master, and now compile fine. But maybe change "#include " in gen/Reference.hpp and gen/Object.hpp to "#include <core/TagDB.hpp>"? Otherwise I have error on compile my project: image

karroffel commented 6 years ago

Oh okay, will do that later