godotengine/gdnative-demos

Sconstruct not update path include .cpp .hpp

abczezeze opened this issue · 5 comments

I watch tutorial at https://www.youtube.com/watch?v=voXapBgDdts&list=PLZ2NyOcFnfQOko5ZysZeGkH3bfw2UtbOK
but include .cpp .hpp of godot such as classes, core, variant. it's different path in 2021 and 2019. 😥

I download on godot-cpp, godot-header, dodge_the_creeps-cpp

I can not create .dll

SConstruct of dodge_the_creeps

godot_headers_path = "godot-cpp/godot-headers"
godot_bindings_path = "godot-cpp"
.
.
.
env.Append(
    CPPPATH=[
        godot_headers_path,
        godot_bindings_path + "/include",
        godot_bindings_path + "/include/gen/",
        godot_bindings_path + "/include/core/",
    ]
)

Cannot open include file: 'godot_cpp/godot.hpp

E:\0DataJue\zzDownload\Godot\GodotProj\gdnative_cpp_example\gdnative-demos-master\cpp\dodge_the_creeps>scons platform=windows
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cl /Fogodot-cpp\src\godot.obj /c godot-cpp\src\godot.cpp /TP /nologo /Z7 /Od /EHsc /D_DEBUG /MDd /DDEBUG_ENABLED /DDEBUG_METHODS_ENABLED /DTYPED_METHOD_BIND /Igodot-cpp /Igodot-cpp\godot-headers /Iinclude /Igen\include
godot.cpp
godot-cpp\src\godot.cpp(31): fatal error C1083: Cannot open include file: 'godot_cpp/godot.hpp': No such file or directory
scons: *** [godot-cpp\src\godot.obj] Error 2
scons: building terminated because of errors.

At godot-cpp folder when using the scons command it creates a gen folder, it's not in the godot_cpp folder.

godot-cpp/gen/
godot-cpp/gen/include
godot-cpp/gen/src
.
.
.
\godot-cpp\include\godot_cpp
\godot-cpp\include\godot_cpp\classes
\godot-cpp\include\godot_cpp\core
\godot-cpp\include\godot_cpp\variant

At godot-cpp\include folder has godot_cpp folder inside before have classes, cores, variables inside.

  • [my issue not gdnative-demos isssue ]

You need to use godot-cpp (with -) not godot_cpp (with _).

Thank you for reply. I don't understand it.

I try to rename folder from godot_cpp to godot-cpp
And move gen folder to godot-cpp\include
not working

It works for me. Try building godot-cpp (which has its own SConstruct) before trying to build the demo. The demo's SConstruct should call godot-cpp's SConstruct, but you should check that godot-cpp is working first.

Take a close look at the error message you are getting. Make sure that the files it's looking for actually exist. You posted above Cannot open include file: 'godot_cpp/godot.hpp': No such file or directory, but this file does not exist (there is godot-cpp/include/core/Godot.hpp).

If you are still having issues try doing a fresh clone and let Git initialize the submodules. It sounds like you are manually moving around folders which should not be required. When you download you want to use the git clone command and then the git submodule update --init command to initialize the submodules.

WOW! thank you for detail answer. I'm stupid and can not thinking if short reply. I didn't fix _ to -

whatever to binding or compile something. I must git clone --recursive https://github.com/godotengine/godot-cpp and then the git submodule update --init --recursive command replace manually download from github.

GitHub is not a support forum. If you need further help consider using one of the community channels such as Discord.