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

[4.0] Unable to compile C++ with SCons, missing binding_generator

Open RayHammer opened this issue 2 years ago • 3 comments

I've migrated my project recently from 3.5 to 4.0 and while trying to compile libraries I get the following error:

ModuleNotFoundError: No module named 'binding_generator':
  File "/home/rayhammer/Documents/Godot/GunPower/SConstruct", line 7:
    from binding_generator import scons_generate_bindings, scons_emit_files

I'm not sure what's wrong since I followed the guide, so any help would be appreciated

RayHammer avatar Apr 21 '23 02:04 RayHammer

Try updating SCons or something. Mine is v4.4.0 and I have managed to build the GDExtensionExample.

xissburg avatar Apr 22 '23 15:04 xissburg

I believe this is because the SConstruct file listed in the documentation here is incorrect. Instead of the one listed in the documentation, this one should be used: https://github.com/godotengine/godot-cpp-template/blob/main/SConstruct

smarthall avatar Feb 06 '24 09:02 smarthall

The example SConstruct in the docs should work. I used it a couple months ago in a live GDExtension demo where it worked, and looking at the code now, it seems fine to me.

The one in godot-cpp-template is more advanced for sure, and that project is a great place to start, but it shouldn't be required.

Returning to the original problem:

I've migrated my project recently from 3.5 to 4.0 and while trying to compile libraries I get the following error:

This could be a matter of not pulling in the updated version of the godot-cpp Git submodule?

In any case, we'd really need to see more of your project to know for sure. Please share an MRP or more details!

dsnopek avatar Feb 12 '24 16:02 dsnopek

Closing due to lack of response, if you provide the requested information this can be reopened

AThousandShips avatar May 23 '24 14:05 AThousandShips