godotengine / godotengine/godot-cpp
Cannot build on Windows 11, pointer reinterpret cast fail
- Dominant language
- C++
- Stars
- 2.7k
- Forks
- 809
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 8
Description
### 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)(reinterpret_cast(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>(), ::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' 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' 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)(reinterpret_cast(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>(), ::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' 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' 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)(reinterpret_cast(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>(), ::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' 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' 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)(reinterpret_cast(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>(), ::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' 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' 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)(reinterpret_cast(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>(), ::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' 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' 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)' to member pointer type 'int (godot::_gde_UnexistingClass::*)(godot::Ref)' of different size
508 | MethodBind *a = memnew((MethodBindTR)(reinterpret_cast(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>(), ::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>' 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)>' 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 &)' to member pointer type 'int (godot::_gde_UnexistingClass::*)(const godot::Ref &)' of different size
508 | MethodBind *a = memnew((MethodBindTR)(reinterpret_cast(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>(), ::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 &>' 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 &)>' 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)' to member pointer type 'godot::String (godot::_gde_UnexistingClass::*)(godot::Ref)' of different size
508 | MethodBind *a = memnew((MethodBindTR)(reinterpret_cast(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>(), ::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>' 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)>' 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 &)' to member pointer type 'godot::String (godot::_gde_UnexistingClass::*)(const godot::Ref &)' of different size
508 | MethodBind *a = memnew((MethodBindTR)(reinterpret_cast(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>(), ::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 &>' 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 &)>' 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)(reinterpret_cast(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>(), ::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' 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' 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)(reinterpret_cast(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>(), ::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' 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' 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 (Example::*)() const' to member pointer type 'godot::Ref (godot::_gde_UnexistingClass::*)() const' of different size
592 | MethodBind *a = memnew((MethodBindTRC)(reinterpret_cast(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>(), ::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>' 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 (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)(reinterpret_cast(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>(), ::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' 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' 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 (Example::*)(godot::Ref) const' to member pointer type 'godot::Ref (godot::_gde_UnexistingClass::*)(godot::Ref) const' of different size
592 | MethodBind *a = memnew((MethodBindTRC)(reinterpret_cast(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>(), ::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, godot::Ref>' 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 (Example::*)(godot::Ref) 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)(reinterpret_cast(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>(), ::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' 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' 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)(reinterpret_cast(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>(), ::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' 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' 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 &)' to member pointer type 'int (godot::_gde_UnexistingClass::*)(const godot::TypedArray &)' of different size
508 | MethodBind *a = memnew((MethodBindTR)(reinterpret_cast(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>(), ::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 &>' 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 &)>' 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 (Example::*)() const' to member pointer type 'godot::TypedArray (godot::_gde_UnexistingClass::*)() const' of different size
592 | MethodBind *a = memnew((MethodBindTRC)(reinterpret_cast(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>(), ::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>' 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 (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)(reinterpret_cast(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>(), ::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' 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' 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();
| ^
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)
```
4. open CMakeLists.txt with qtcreator, and trigger compilation
### Minimal reproduction project
[test.zip](https://github.com/user-attachments/files/20847860/test.zip)
This is the project. I did not move the directory, it should be "godot-cpp\test".
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.