godot-cpp icon indicating copy to clipboard operation
godot-cpp copied to clipboard

Cannot build on Windows 11, pointer reinterpret cast fail

Open Roger-Qea opened this issue 6 months ago • 4 comments

Godot version

4.4.1

godot-cpp version

4.4.1

System information

Win11, AMD-9950X

Issue description

I am using win11, MSVC 17.14.6 (the default CppCompiler and clang19.1.5(install through VS)). Even the default "test" example cannot pass the compilation, the error log is here. It seems that on windows platform, casting function pointer is not allowed, so binding function will fail. This issue does not appear on linux or other platform I am using.

01:57:09: Running steps for project Project...
01:57:09: Starting: "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build R:/Godot/godot-cpp/test/build/CLang-Debug --target all
jom: parallel job execution disabled for Makefile
[ 33%] Building CXX object CMakeFiles/godot-cpp-test.dir/src/example.obj
[ 66%] Building CXX object CMakeFiles/godot-cpp-test.dir/src/register_types.obj
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:347:44: error: cannot reinterpret_cast from member pointer type 'void (ExampleRef::*)(int)' to member pointer type 'void (godot::_gde_UnexistingClass::*)(int)' of different size
  347 | MethodBind *a = memnew((MethodBindT<P...>)(reinterpret_cast<void (MB_T::*)(P...)>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<ExampleRef, int>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:80:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, void (ExampleRef::*)(int)>' requested here
   80 |         ClassDB::bind_method(D_METHOD("set_id", "id"), &ExampleRef::set_id);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:592:49: error: cannot reinterpret_cast from member pointer type 'int (ExampleRef::*)() const' to member pointer type 'int (godot::_gde_UnexistingClass::*)() const' of different size
  592 | MethodBind *a = memnew((MethodBindTRC<R, P...>)(reinterpret_cast<R (MB_T::*)(P...) const>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<ExampleRef, int>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:81:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, int (ExampleRef::*)() const>' requested here
   81 |         ClassDB::bind_method(D_METHOD("get_id"), &ExampleRef::get_id);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:592:49: error: cannot reinterpret_cast from member pointer type 'bool (ExampleRef::*)() const' to member pointer type 'bool (godot::_gde_UnexistingClass::*)() const' of different size
  592 | MethodBind *a = memnew((MethodBindTRC<R, P...>)(reinterpret_cast<R (MB_T::*)(P...) const>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<ExampleRef, bool>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:83:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, bool (ExampleRef::*)() const>' requested here
   83 |         ClassDB::bind_method(D_METHOD("was_post_initialized"), &ExampleRef::was_post_initialized);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:347:44: error: cannot reinterpret_cast from member pointer type 'void (Example::*)()' to member pointer type 'void (godot::_gde_UnexistingClass::*)()' of different size
  347 | MethodBind *a = memnew((MethodBindT<P...>)(reinterpret_cast<void (MB_T::*)(P...)>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:185:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, void (Example::*)()>' requested here
  185 |         ClassDB::bind_method(D_METHOD("simple_func"), &Example::simple_func);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:425:46: error: cannot reinterpret_cast from member pointer type 'void (Example::*)() const' to member pointer type 'void (godot::_gde_UnexistingClass::*)() const' of different size
  425 |         MethodBind *a = memnew((MethodBindTC<P...>)(reinterpret_cast<void (MB_T::*)(P...) const>(p_method)));
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:186:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, void (Example::*)() const>' requested here
  186 |         ClassDB::bind_method(D_METHOD("simple_const_func"), &Example::simple_const_func);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:508:49: error: cannot reinterpret_cast from member pointer type 'int (Example::*)(godot::Ref<ExampleRef>)' to member pointer type 'int (godot::_gde_UnexistingClass::*)(godot::Ref<ExampleRef>)' of different size
  508 |         MethodBind *a = memnew((MethodBindTR<R, P...>)(reinterpret_cast<R (MB_T::*)(P...)>(p_method)));
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, int, godot::Ref<ExampleRef>>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:187:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, int (Example::*)(godot::Ref<ExampleRef>)>' requested here
  187 |         ClassDB::bind_method(D_METHOD("custom_ref_func", "ref"), &Example::custom_ref_func);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:508:49: error: cannot reinterpret_cast from member pointer type 'int (Example::*)(const godot::Ref<ExampleRef> &)' to member pointer type 'int (godot::_gde_UnexistingClass::*)(const godot::Ref<ExampleRef> &)' of different size
  508 |         MethodBind *a = memnew((MethodBindTR<R, P...>)(reinterpret_cast<R (MB_T::*)(P...)>(p_method)));
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, int, const godot::Ref<ExampleRef> &>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:188:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, int (Example::*)(const godot::Ref<ExampleRef> &)>' requested here
  188 |         ClassDB::bind_method(D_METHOD("custom_const_ref_func", "ref"), &Example::custom_const_ref_func);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:508:49: error: cannot reinterpret_cast from member pointer type 'godot::String (Example::*)(godot::Ref<godot::Image>)' to member pointer type 'godot::String (godot::_gde_UnexistingClass::*)(godot::Ref<godot::Image>)' of different size
  508 |         MethodBind *a = memnew((MethodBindTR<R, P...>)(reinterpret_cast<R (MB_T::*)(P...)>(p_method)));
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, godot::String, godot::Ref<godot::Image>>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:189:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, godot::String (Example::*)(godot::Ref<godot::Image>)>' requested here
  189 |         ClassDB::bind_method(D_METHOD("image_ref_func", "image"), &Example::image_ref_func);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:508:49: error: cannot reinterpret_cast from member pointer type 'godot::String (Example::*)(const godot::Ref<godot::Image> &)' to member pointer type 'godot::String (godot::_gde_UnexistingClass::*)(const godot::Ref<godot::Image> &)' of different size
  508 |         MethodBind *a = memnew((MethodBindTR<R, P...>)(reinterpret_cast<R (MB_T::*)(P...)>(p_method)));
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, godot::String, const godot::Ref<godot::Image> &>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:190:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, godot::String (Example::*)(const godot::Ref<godot::Image> &)>' requested here
  190 |         ClassDB::bind_method(D_METHOD("image_const_ref_func", "image"), &Example::image_const_ref_func);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:508:49: error: cannot reinterpret_cast from member pointer type 'godot::String (Example::*)(const godot::String &)' to member pointer type 'godot::String (godot::_gde_UnexistingClass::*)(const godot::String &)' of different size
  508 |         MethodBind *a = memnew((MethodBindTR<R, P...>)(reinterpret_cast<R (MB_T::*)(P...)>(p_method)));
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, godot::String, const godot::String &>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:191:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, godot::String (Example::*)(const godot::String &)>' requested here
  191 |         ClassDB::bind_method(D_METHOD("return_something"), &Example::return_something);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:592:49: error: cannot reinterpret_cast from member pointer type 'godot::Viewport *(Example::*)() const' to member pointer type 'godot::Viewport *(godot::_gde_UnexistingClass::*)() const' of different size
  592 | MethodBind *a = memnew((MethodBindTRC<R, P...>)(reinterpret_cast<R (MB_T::*)(P...) const>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, godot::Viewport *>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:192:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, godot::Viewport *(Example::*)() const>' requested here
  192 |         ClassDB::bind_method(D_METHOD("return_something_const"), &Example::return_something_const);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:592:49: error: cannot reinterpret_cast from member pointer type 'godot::Ref<ExampleRef> (Example::*)() const' to member pointer type 'godot::Ref<ExampleRef> (godot::_gde_UnexistingClass::*)() const' of different size
  592 | MethodBind *a = memnew((MethodBindTRC<R, P...>)(reinterpret_cast<R (MB_T::*)(P...) const>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, godot::Ref<ExampleRef>>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:193:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, godot::Ref<ExampleRef> (Example::*)() const>' requested here
  193 |         ClassDB::bind_method(D_METHOD("return_empty_ref"), &Example::return_empty_ref);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:592:49: error: cannot reinterpret_cast from member pointer type 'ExampleRef *(Example::*)() const' to member pointer type 'ExampleRef *(godot::_gde_UnexistingClass::*)() const' of different size
  592 | MethodBind *a = memnew((MethodBindTRC<R, P...>)(reinterpret_cast<R (MB_T::*)(P...) const>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, ExampleRef *>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:194:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, ExampleRef *(Example::*)() const>' requested here
  194 |         ClassDB::bind_method(D_METHOD("return_extended_ref"), &Example::return_extended_ref);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:592:49: error: cannot reinterpret_cast from member pointer type 'godot::Ref<ExampleRef> (Example::*)(godot::Ref<ExampleRef>) const' to member pointer type 'godot::Ref<ExampleRef> (godot::_gde_UnexistingClass::*)(godot::Ref<ExampleRef>) const' of different size
  592 | MethodBind *a = memnew((MethodBindTRC<R, P...>)(reinterpret_cast<R (MB_T::*)(P...) const>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, godot::Ref<ExampleRef>, godot::Ref<ExampleRef>>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:195:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, godot::Ref<ExampleRef> (Example::*)(godot::Ref<ExampleRef>) const>' requested here
  195 |         ClassDB::bind_method(D_METHOD("extended_ref_checks", "ref"), &Example::extended_ref_checks);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:592:49: error: cannot reinterpret_cast from member pointer type 'bool (Example::*)() const' to member pointer type 'bool (godot::_gde_UnexistingClass::*)() const' of different size
  592 | MethodBind *a = memnew((MethodBindTRC<R, P...>)(reinterpret_cast<R (MB_T::*)(P...) const>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, bool>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:197:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, bool (Example::*)() const>' requested here
  197 |         ClassDB::bind_method(D_METHOD("is_object_binding_set_by_parent_constructor"), &Example::is_object_binding_set_by_parent_constructor);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:592:49: error: cannot reinterpret_cast from member pointer type 'godot::Array (Example::*)() const' to member pointer type 'godot::Array (godot::_gde_UnexistingClass::*)() const' of different size
  592 | MethodBind *a = memnew((MethodBindTRC<R, P...>)(reinterpret_cast<R (MB_T::*)(P...) const>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, godot::Array>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:199:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, godot::Array (Example::*)() const>' requested here
  199 |         ClassDB::bind_method(D_METHOD("test_array"), &Example::test_array);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:508:49: error: cannot reinterpret_cast from member pointer type 'int (Example::*)(const godot::TypedArray<int64_t> &)' to member pointer type 'int (godot::_gde_UnexistingClass::*)(const godot::TypedArray<int64_t> &)' of different size
  508 |         MethodBind *a = memnew((MethodBindTR<R, P...>)(reinterpret_cast<R (MB_T::*)(P...)>(p_method)));
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, int, const godot::TypedArray<int64_t> &>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:200:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, int (Example::*)(const godot::TypedArray<int64_t> &)>' requested here
  200 |         ClassDB::bind_method(D_METHOD("test_tarray_arg", "array"), &Example::test_tarray_arg);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:592:49: error: cannot reinterpret_cast from member pointer type 'godot::TypedArray<Vector2> (Example::*)() const' to member pointer type 'godot::TypedArray<Vector2> (godot::_gde_UnexistingClass::*)() const' of different size
  592 | MethodBind *a = memnew((MethodBindTRC<R, P...>)(reinterpret_cast<R (MB_T::*)(P...) const>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, godot::TypedArray<Vector2>>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:201:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, godot::TypedArray<Vector2> (Example::*)() const>' requested here
  201 |         ClassDB::bind_method(D_METHOD("test_tarray"), &Example::test_tarray);
      |                  ^
In file included from R:\Godot\godot-cpp\test\src\example.cpp:6:
In file included from R:\Godot\godot-cpp\test\src\example.h:17:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/control.hpp:36:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/canvas_item.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/node.hpp:37:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/classes/ref.hpp:37:
In file included from R:/Godot/godot-cpp/test/../gen/include\godot_cpp/classes/ref_counted.hpp:39:
In file included from R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:38:
R:/Godot/godot-cpp/test/../include\godot_cpp/core/method_bind.hpp:592:49: error: cannot reinterpret_cast from member pointer type 'godot::Dictionary (Example::*)() const' to member pointer type 'godot::Dictionary (godot::_gde_UnexistingClass::*)() const' of different size
  592 | MethodBind *a = memnew((MethodBindTRC<R, P...>)(reinterpret_cast<R (MB_T::*)(P...) const>(p_method)));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/memory.hpp:100:95: note: expanded from macro 'memnew'
  100 | #define memnew(m_class) (::godot::_pre_initialize<std::remove_pointer_t<decltype(new ("", "") m_class)>>(), ::godot::_post_initialize(new ("", "") m_class))
      |                                                                                               ^~~~~~~
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:316:21: note: in instantiation of function template specialization 'godot::create_method_bind<Example, godot::Dictionary>' requested here
  316 |         MethodBind *bind = create_method_bind(p_method);
      |                            ^
R:\Godot\godot-cpp\test\src\example.cpp:202:11: note: in instantiation of function template specialization 'godot::ClassDB::bind_method<godot::MethodDefinition, godot::Dictionary (Example::*)() const>' requested here
  202 |         ClassDB::bind_method(D_METHOD("test_dictionary"), &Example::test_dictionary);
      |                  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
jom: R:\Godot\godot-cpp\test\build\CLang-Debug\CMakeFiles\godot-cpp-test.dir\build.make [CMakeFiles\godot-cpp-test.dir\src\example.obj] Error 1
R:\Godot\godot-cpp\test\src\register_types.cpp:33:19: error: unknown type name 'ExamplePrzykład'; did you mean 'ExamplePrzyklad'?
   33 |         GDREGISTER_CLASS(ExamplePrzykład);
      |                          ^~~~~~~~~~~~~~~
      |                          ExamplePrzyklad
R:/Godot/godot-cpp/test/../include\godot_cpp/core/class_db.hpp:364:68: note: expanded from macro 'GDREGISTER_CLASS'
  364 | #define GDREGISTER_CLASS(m_class) ::godot::ClassDB::register_class<m_class>();
      |                                                                    ^
R:\Godot\godot-cpp\test\src\example.h:283:7: note: 'ExamplePrzyklad' declared here
  283 | class ExamplePrzyklad : public RefCounted {
      |       ^
1 error generated.
jom: R:\Godot\godot-cpp\test\build\CLang-Debug\CMakeFiles\godot-cpp-test.dir\build.make [CMakeFiles\godot-cpp-test.dir\src\register_types.obj] Error 1
jom: R:\Godot\godot-cpp\test\build\CLang-Debug\CMakeFiles\Makefile2 [CMakeFiles\godot-cpp-test.dir\all] Error 2
jom: R:\Godot\godot-cpp\test\build\CLang-Debug\Makefile [all] Error 2
01:57:10: The command "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe --build R:/Godot/godot-cpp/test/build/CLang-Debug --target all" terminated with exit code 2.
01:57:10: Error while building/deploying project Project (kit: CLang)
01:57:10: When executing step "Build"
01:57:10: Elapsed time: 00:01.

Steps to reproduce

  1. Download godot-cpp-godot-4.4.1-stable.tar.gz and unzip;
  2. Compile the godot-cpp: scons platform=windows target=template_release dev_build=yes use_llvm=yes
  3. in the test CMakeLists.txt, I added the following content
include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/../include/
    ${CMAKE_CURRENT_SOURCE_DIR}/../gen/include/
    ${CMAKE_CURRENT_SOURCE_DIR}/../gdextension/
)
set(GODOTCPP_SYMBOL_VISIBILITY "default")

add_library(${TARGET_NAME} SHARED)
  1. open CMakeLists.txt with qtcreator, and trigger compilation

Minimal reproduction project

test.zip This is the project. I did not move the directory, it should be "godot-cpp\test".

Roger-Qea avatar Jun 21 '25 18:06 Roger-Qea

  • Compile the godot-cpp: scons platform=windows target=template_release dev_build=yes use_llvm=yes

  • in the test CMakeLists.txt, I added the following content

You appear to be mixing build systems unnecessarily.

Have a look at the godot-cpp-template template for a working example that you can adapt to your needs.

The test folder is not intended to be used as a test project, it is for integration testing in github CI

Can you walk me through your timeline of how you made your decisions and got to this point?

enetheru avatar Jun 21 '25 23:06 enetheru

  • Compile the godot-cpp: scons platform=windows target=template_release dev_build=yes use_llvm=yes
  • in the test CMakeLists.txt, I added the following content

You appear to be mixing build systems unnecessarily.

Have a look at the godot-cpp-template template for a working example that you can adapt to your needs.

The test folder is not intended to be used as a test project, it is for integration testing in github CI

Can you walk me through your timeline of how you made your decisions and got to this point?

Thank you for your reply.

Initially, I developed my GDExtension on Linux using scons compilation system (same as the official documentation). However, when several GDExtension projects share one godot-cpp, compiling of GDExtensions frequently triggers a new compiling process of godot-cpp. As godot-cpp is only depending on the engine and should not be changed nor recompiled, (and its compilation is relatively slow because there are so many small files), I wanted to stop/skip that.

I am not familiar with scons. On the other hand, I think the GDExtension compiling mechanism may be simple: including the godot-cpp headers + linking godot-cpp static lib + producing a dynamic lib to the engine. Therefore I use cmake. Cmake works very well on Linux, compiling fast, no recompiling godot-cpp (as it is not in the project at all, excepting header files and one ".a" file).

Then, when I want to port my projects to Windows, I meet these errors. They looks strange for me, at least I have not seen a pointer cannot be casted to another pointer in C/C++ before.

It is fine for me to use scons on Windows. It would be very nice if you could tell me how to avoid GDExtension triggering godot-cpp recompilation, or how to fix the cmake on Windows.

Roger-Qea avatar Jun 25 '25 11:06 Roger-Qea

OK I'll do my best to respond, perhaps if i get anything wrong someone else can weigh in.

However, when several GDExtension projects share one godot-cpp

That's not really the intended use case AFAIK, because it's only intended to be a thin shim over engine functions, and highly tuned to meet your extensions needs, and so sharing the compile result between extensions was never the goal. Which leads into the next point

its compilation is relatively slow because there are so many small files

Set up the build profile to only compile what you need. my extension only builds 75 or so files, not the ~1000 for all possible functionality of which only a handful will ever actually be called. it's very easy to to, just some lines in the build_profile.json or something like that, its been a minute since I did it last. Once its built to your needs for a specific project, it rarely gets re-built unless you change compile options.

Cmake works very well on Linux, compiling fast, no recompiling godot-cpp (as it is not in the project at all, excepting header files and one ".a" file

If I understand, you are consuming the results of the scons build in your cmake build? if thats the case, then yes, its considered external and has no way to re-compile godot-cpp. There is support to use cmake across the board though, using fetchcontent or external project or as a submodule and add_subdirectory ( psl dont quote me on exact syntax ) you dont have to compile with scons, though I dont mind either way personally.

It would be very nice if you could tell me how to avoid GDExtension triggering godot-cpp recompilation, or how to fix the cmake on Windows.

I highly recommend starting from the template project, it will save you a lot of time setting the build up, and it works everywhere to my knowledge. I have tested it on windows using all major compilers and environments that i know of.

enetheru avatar Jun 25 '25 11:06 enetheru

@Roger-Qea did you have any luck or change your build process? Do you need any further information or can this issue be closed?

enetheru avatar Oct 18 '25 06:10 enetheru