You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to compile godot_cpp + my lib that includes godot_cpp using clang and ninja on Windows 11,
when calling
godot::ClassDB::bind_method(...)
I get a compile error
In file included from C:/Users/user/dev/project/GDClient/src/MyClass.h:11:
In file included from C:/Users/user/dev/project/build/libs/godot-cpp/gen/include\godot_cpp/classes/engine.hpp:43:
In file included from C:/Users/user/dev/project/libs/godot-cpp/include\godot_cpp/core/class_db.hpp:38:
C:/Users/user/dev/project/libs/godot-cpp/include\godot_cpp/core/method_bind.hpp:506:49: error: cannot reinterpret_cast from member pointer type 'godot::NodePath (MyClass::)()' to member pointer type 'godot::NodePath (godot::_gde_UnexistingClass::)()' of different size
MethodBind a = memnew((MethodBindTR<R, P...>)(reinterpret_cast<R (MB_T::)(P...)>(p_method)));
On Linux CMake + Ninja + Clang works flawlessly.
I tried to look where to issue could be occurring. I found out when I remove MSVC condition from CMakeLists.txt:157
from:
target_compile_definitions(${PROJECT_NAME} PUBLIC
$<$<CONFIG:Debug>:
DEBUG_ENABLED
DEBUG_METHODS_ENABLED
>
$<${compiler_is_msvc}:
TYPED_METHOD_BIND
/>
)
to:
target_compile_definitions(${PROJECT_NAME} PUBLIC
$<$<CONFIG:Debug>:
DEBUG_ENABLED
DEBUG_METHODS_ENABLED
>
TYPED_METHOD_BIND
)
This effectively resolved the errors and got a successful build.
Although I am not really sure if that fixes things properly and does not create issues elsewhere.
Steps to reproduce
Link godot_cpp to your library
Bind one of your methods using godot::ClassDB::bind_method
Run CMake with build system Ninja and compiler Clang
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered:
Godot version
4.1.1 stable
godot-cpp version
4.1.1 stable 1009da4
System information
Windows 11
Issue description
When trying to compile godot_cpp + my lib that includes godot_cpp using clang and ninja on Windows 11,
when calling
godot::ClassDB::bind_method(...)
I get a compile error
On Linux CMake + Ninja + Clang works flawlessly.
I tried to look where to issue could be occurring. I found out when I remove MSVC condition from CMakeLists.txt:157
from:
to:
This effectively resolved the errors and got a successful build.
Although I am not really sure if that fixes things properly and does not create issues elsewhere.
Steps to reproduce
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: