![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | KoukouStudios |
Godot is an awesome engine but it strongly resists to the easy use of any other language but gdscript that I’m not so fond of. To the point:
Trying to get the GDNative C++ tutorial from the official documentation to compile (GDNative C example — Godot Engine (3.2) documentation in English) but I get some link errors that I can’t figure out how to solve. First time using scons. The api and the bin library generation went fine. The problems start when trying to compile the plugin. Maybe something wrong with my directory structure? I took a look at the SConstruct file though and all paths seem fine.
D:_Gamedev\Godot\Projects\game>scons platform=windows
scons: Reading SConscript files …
scons: done reading SConscript files.
scons: Building targets …
link /nologo -DEBUG /dll /out:game\bin\win64\libgdexample.dll /implib:game\bin\win64\libgdexample.lib /LIBPATH:godot-cpp\bin libgodot-cpp.windows.debug.64.lib src\gdexample.obj src\gdlibrary.obj
Creating library game\bin\win64\libgdexample.lib and object game\bin\win64\libgdexample.exp
gdexample.obj : error LNK2019: unresolved external symbol “public: __thiscall godot::Variant::Variant(class godot::Variant const &)” (??0Variant@godot@@QAE@ABV01@@Z) referenced in function “public: void __thiscall godot::_WrappedMethod<class godot::GDExample,void,float>::apply<0>(class godot::Variant *,class godot::GDExample *,class godot::Variant * *,struct godot::__Sequence<0>)” (??$apply@$0A@@?$_WrappedMethod@VGDExample@godot@@XM@godot@@QAEXPAVVariant@1@PAVGDExample@1@PAPAV21@U?$__Sequence@$0A@@1@@Z)
gdexample.obj : error LNK2019: unresolved external symbol "public: __thiscall godot::Variant::operator float(void)const " (??BVariant@godot@@QBEMXZ) referenced in function “public: static float __cdecl godot::_ArgCast::_arg_cast(class godot::Variant)” (?_arg_cast@?$_ArgCast@M@godot@@SAMVVariant@2@@Z)
gdexample.obj : error LNK2019: unresolved external symbol “public: __thiscall godot::Variant::~Variant(void)” (??1Variant@godot@@QAE@XZ) referenced in function “public: static float __cdecl godot::_ArgCast::_arg_cast(class godot::Variant)” (?_arg_cast@?$_ArgCast@M@godot@@SAMVVariant@2@@Z)
gdexample.obj : error LNK2019: unresolved external symbol “public: void __thiscall godot::Node2D::set_position(struct godot::Vector2)” (?set_position@Node2D@godot@@QAEXUVector2@2@@Z) referenced in function “public: void __thiscall godot::GDExample::_process(float)” (?_process@GDExample@godot@@QAEXM@Z)
gdexample.obj : error LNK2001: unresolved external symbol _api
gdexample.obj : error LNK2001: unresolved external symbol _nativescript_api
gdlibrary.obj : error LNK2001: unresolved external symbol _nativescript_api
gdexample.obj : error LNK2001: unresolved external symbol “public: static void * godot::_RegisterState::nativescript_handle” (?nativescript_handle@_RegisterState@godot@@2PAXA)
gdlibrary.obj : error LNK2001: unresolved external symbol “public: static void * godot::_RegisterState::nativescript_handle” (?nativescript_handle@_RegisterState@godot@@2PAXA)
gdlibrary.obj : error LNK2019: unresolved external symbol “public: static void __cdecl godot::Godot::gdnative_init(struct godot_gdnative_init_options *)” (?gdnative_init@Godot@godot@@SAXPAUgodot_gdnative_init_options@@@Z) referenced in function _godot_gdnative_init
gdlibrary.obj : error LNK2019: unresolved external symbol “public: static void __cdecl godot::Godot::gdnative_terminate(struct godot_gdnative_terminate_options *)” (?gdnative_terminate@Godot@godot@@SAXPAUgodot_gdnative_terminate_options@@@Z) referenced in function _godot_gdnative_terminate
gdlibrary.obj : error LNK2019: unresolved external symbol “public: static void __cdecl godot::Godot::nativescript_init(void *)” (?nativescript_init@Godot@godot@@SAXPAX@Z) referenced in function _godot_nativescript_init
gdlibrary.obj : error LNK2019: unresolved external symbol “void __cdecl godot::_TagDB::register_type(unsigned int,unsigned int)” (?register_type@_TagDB@godot@@YAXII@Z) referenced in function “void __cdecl godot::register_class(void)” (??$register_class@VGDExample@godot@@@godot@@YAXXZ)
gdlibrary.obj : error LNK2001: unresolved external symbol _nativescript_1_1_api
libgodot-cpp.windows.debug.64.lib : warning LNK4272: library machine type ‘x64’ conflicts with target machine type ‘x86’
game\bin\win64\libgdexample.dll : fatal error LNK1120: 12 unresolved externals
scons: *** [game\bin\win64\libgdexample.dll] Error 1120
scons: building terminated because of errors.
Okay, I wrote a simple non-agnostic SConstruct and managed to build it. I guess the SCostruct provided with the tutorial is messed up.
KoukouStudios | 2020-03-21 20:54
Please report this on the Godot documentation repository
Calinou | 2020-03-24 09:17