Repository: godot
Issue: Running into unresolved external symbol errors during GDNative example
Labels: topic:gdextension

### Godot version

3.4

### System information

Windows 10

### Issue description

I am going through the [GDNative C++ example](https://docs.godotengine.org/en/stable/tutorials/scripting/gdnative/gdnative_cpp_example.html) and am currently on the ['Compiling the plugin'](https://docs.godotengine.org/en/stable/tutorials/scripting/gdnative/gdnative_cpp_example.html#compiling-the-plugin) step. I'm using Visual Studio 2022 and versions 3.4 of godot-headers and godot-cpp. 

When I try to compile the sample plugin with scons platform=windows, I receive the following set of error messages:

```
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<float>::_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<float>::_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<class godot::GDExample>(void)" (??$register_class@VGDExample@godot@@@godot@@YAXXZ)
gdlibrary.obj : error LNK2001: unresolved external symbol _nativescript_1_1_api
gdlibrary.obj : error LNK2001: unresolved external symbol "private: static void * godot::Sprite::_detail_class_tag" (?_detail_class_tag@Sprite@godot@@0PAXA)
godot-cpp\bin\libgodot-cpp.windows.debug.64.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
demo\bin\win64\libgdexample.dll : fatal error LNK1120: 13 unresolved externals
scons: *** [demo\bin\win64\libgdexample.dll] Error 1120
scons: building terminated because of errors.
```

I'm not sure whether I need to update the Sconstruct file, the gdexample.cpp/gdexample.h/gdlibrary.cpp files, or something else. Thank you in advance for your help!







### Steps to reproduce

I believe I've followed the steps in the GDNative C++ tutorial accurately so far. Perhaps my use of Visual Studio 2022 (as opposed to an earlier version) is contributing to this issue. 



### Minimal reproduction project

The .zip version of my folder was too large to upload here, so I uploaded a copy to Google Drive instead:

https://drive.google.com/file/d/1wFYuPgbiIuqVddUoefdQJFFJVMYlu03W/view?usp=sharing