Open njelly opened 1 year ago
From what I gather of your trace low_level.cpp
and wrapper.cpp
should not be included as these files do not exist in the classes directory AFIK. Which headers did you include?
I have not included any headers, I am just going line by line through the tutorial described on that page. I have none of my own existing project code, in fact I am a novice to Godot entirely.
Sorry I didn't mean to sound condescending in any way. I think you may need to check that you have
Side note: I would advise to get familiar with the engine first before trying out GDExtension.
4.1
for the godot-cpp submoduleextension_api.json
file generated by the previous step (although the tutorial is not clear where this file should go).godot
. The repository contains a copy of the metadata for the current Godot release, but if you need to build these bindings for a newer version of Godot, simply call the Godot executable:
godot --dump-extension-api extension_api.json
Place the resulting extension_api.json file in the project folder and add custom_api_file=
to the scons command below.
The instructions are there. The path can be relative. To build godot-cpp you run the scons custom_api_file=<PATH_TO_FILE>
inside godot-cpp to build the library. But that is ONLY needed for newer versions which aren't available as separate branches in the Godot-cpp repository. You can instead just run scons platform=<PLATFORM> -j4
in your case since you are building within the 4.1 branch.
I'm also getting similar errors. All I'm doing here is running scons platform=windows
in test
directory. I can't open the included project either. My godot version is Godot_v4.1.1-stable, my godot-cpp tag is godot-4.1.1-stable. What's wrong? I believe I followed the steps as described.
scons: done reading SConscript files.
scons: Building targets ...
g++ -o W:\Projects\Godot\godot-cpp\src\godot.windows.template_debug.x86_64.o -c -std=c++17 -Wwrite-strings -O2 -DWINDOWS_ENABLED -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -DNDEBUG -IW:\Projects\Godot\godot-cpp\gdextension -IW:\Projects\Godot\godot-cpp\include -IW:\Projects\Godot\godot-cpp\gen\include -IW:\Projects\Godot\godot-cpp\src W:\Projects\Godot\godot-cpp\src\godot.cpp
g++ -o W:\Projects\Godot\godot-cpp\src\classes\editor_plugin.windows.template_debug.x86_64.o -c -std=c++17 -Wwrite-strings -O2 -DWINDOWS_ENABLED -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -DNDEBUG -IW:\Projects\Godot\godot-cpp\gdextension -IW:\Projects\Godot\godot-cpp\include -IW:\Projects\Godot\godot-cpp\gen\include -IW:\Projects\Godot\godot-cpp\src W:\Projects\Godot\godot-cpp\src\classes\editor_plugin.cpp
g++ -o W:\Projects\Godot\godot-cpp\src\classes\low_level.windows.template_debug.x86_64.o -c -std=c++17 -Wwrite-strings -O2 -DWINDOWS_ENABLED -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -DNDEBUG -IW:\Projects\Godot\godot-cpp\gdextension -IW:\Projects\Godot\godot-cpp\include -IW:\Projects\Godot\godot-cpp\gen\include -IW:\Projects\Godot\godot-cpp\src W:\Projects\Godot\godot-cpp\src\classes\low_level.cpp
scons: *** [W:\Projects\Godot\godot-cpp\src\godot.windows.template_debug.x86_64.o] The system cannot find the file specified
g++ -o W:\Projects\Godot\godot-cpp\src\classes\wrapped.windows.template_debug.x86_64.o -c -std=c++17 -Wwrite-strings -O2 -DWINDOWS_ENABLED -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -DNDEBUG -IW:\Projects\Godot\godot-cpp\gdextension -IW:\Projects\Godot\godot-cpp\include -IW:\Projects\Godot\godot-cpp\gen\include -IW:\Projects\Godot\godot-cpp\src W:\Projects\Godot\godot-cpp\src\classes\wrapped.cpp
scons: *** [W:\Projects\Godot\godot-cpp\src\classes\editor_plugin.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: *** [W:\Projects\Godot\godot-cpp\src\classes\low_level.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: *** [W:\Projects\Godot\godot-cpp\src\classes\wrapped.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: building terminated because of errors.
Edit: this issue was solved for me personally by reinstalling my compiler using visual studio installer. This isn't a guaranteed fix for the op though.
I had the same error using Godot 4.2 because I hadn't installed a C++ compiler yet, which provides the "g++" command seen in the output I followed an article which allowed me to install g++ version 6.3.0 but then I got different compiler errors which after googling I figured out was because I needed g++ version 7 or later
I downloaded version 13 from here and could successfully run the scons command in the godot docs tutorial
I think the docs should be updated to mention more about the C++ compiler requirement
I had a similar issue, because I only had a Preview version of Visual Studio installed. Installing a regular release version fixed my compile issues.
Your Godot version: 4.1
Issue description: GDExtension documentation commands lead to errors
URL to the documentation page: https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_cpp_example.html#doc-gdextension-cpp-example
I have followed these instructions up to this command:
scons platform=<platform> -j4 custom_api_file=<PATH_TO_FILE>
It gives the following output:
I have spent the time to make sure
scons
,cl
,godot
, etc., are all present in my Path.EDIT: adding
bits=64
to the command does not fix the error