Need help setting up godot for c++

i use gcc

Scons should figure out the compiler stuff.

So did you try to start it from your extension top directory? If you start it from godot-cpp it likely won’t read the proper SConstruct file.

if you mean run the scons in the gdextention folder yes, but it didn’t work, there is no sconstruct there

Umm… you said you followed the tutorial. It says that you need to put the provided SConstruct there.

1 Like
scons platform=windows use_mingw=yes custom_api_file=<PATH_TO_FILE>

how about trying this command?

i wanted to stay in the “building the c++ plugins” section until i fixed this, last time i skipped things didn’t go well

1 Like

Try adding bits=64 to the command line arguments, alongside what @mrcook suggested above.

ok, now something strange happened, i wrote scons without any other command by accident and it complied the whole thing with no issue, i even tryed to rewrite the scons command that kept giving me problem but now the output is this


i don’t know if this is good or bad, all i did was drag the extension-api made by godot in the gdextention folder and replace the one that was already there

compiling without extensions-api.json means that the library you compiled has no idea what a Node2D(example) is so when you try to compile later your bindings set by c++ library will compile but won’t run within Godot because the library has no idea how to bind the c++ to Godot.

does it mean that i have to redo the whole thing again?

you can just delete bin\libgodot-cpp.windows.template_debug.x86_64.lib and try running scons again

i run this now

scons platform=windows bits=64 custom_api_file=C:\filepath\gdextension_cpp_example\godot-cpp\gdextension\extension_api.json

and it gave me this

try the rest of the tutorial and see how it goes :+1:

IT WORKED



1 Like

i redid the whole thing again, but this time i started scons in vscode and wrote bits=64
i also followed the configuring an IDE tutorial for vscode
now it finds everything


this is the only problem that remains, when i run the scons to compile the project.
also the gdexample node dosen’t appear in godot
this is the launch.json

The compiled extension is supposed to be a runtime library (dll on windows), not an exe

you mean like this ones?


these are in the demo/bin folder

Yes, the final result of your build is supposed to be a runtime library. That’s what is (hot)loaded into engine as an extension.

when i did the scons build here it compiled everything with no issue, i have no idea why that file is missing