briansemrau / godot_box2d

A C++ module that integrates the Box2D library with the Godot game engine by providing nodes for standard Box2D objects.
MIT License
44 stars 4 forks source link

Fails to compile on Linux and macOS editor #72

Closed Xrayez closed 2 years ago

Xrayez commented 3 years ago

I maintain a list of C++ modules for Godot at https://github.com/goostengine/godot-modules, and provide build artifacts for users to try out various modules that way.

Linux

https://github.com/goostengine/godot-modules/runs/3050601547#step:7:1395:

In file included from /home/runner/work/godot-modules/godot-modules/modules/godot_box2d/scene/2d/box2d_physics_body.h:18,
                 from /home/runner/work/godot-modules/godot-modules/modules/godot_box2d/scene/2d/box2d_physics_body.cpp:1:
/home/runner/work/godot-modules/godot-modules/modules/godot_box2d/scene/2d/box2d_joints.h:63:25: error: 'Box2DPhysicsBody' has not been declared
   63 |  void on_node_predelete(Box2DPhysicsBody *node);
      |                         ^~~~~~~~~~~~~~~~

https://github.com/goostengine/godot-modules/runs/3050601547#step:7:1441

/home/runner/work/godot-modules/godot-modules/modules/godot_box2d/scene/2d/box2d_physics_body.cpp: In member function 'void Box2DPhysicsBody::_notification(int)':
/home/runner/work/godot-modules/godot-modules/modules/godot_box2d/scene/2d/box2d_physics_body.cpp:328:41: error: cannot convert 'Box2DPhysicsBody*' to 'int*'
  328 |     joint->get()->on_node_predelete(this);
      |

macOS

https://github.com/goostengine/godot-modules/runs/3050601550?check_suite_focus=true#step:6:15869

In file included from /Users/runner/work/godot-modules/godot-modules/modules/godot_box2d/scene/2d/box2d_physics_body.h:18:
/Users/runner/work/godot-modules/godot-modules/modules/godot_box2d/scene/2d/box2d_joints.h:63:25: error: unknown type name 'Box2DPhysicsBody'
        void on_node_predelete(Box2DPhysicsBody *node);
                               ^

Resolving these issues must also help #33 in the future.


I'm using custom_modules build option, Godot 3.x branch.

Builds fine on Windows.

briansemrau commented 3 years ago

This is because of a circular include. Just a couple lines to fix. I'll make a PR at some point.