Open GittyGrubHub85 opened 4 years ago
In your SConstruct file, look at the lines with env.Append(CPPPATH
.
These lines add directories for the compiler to look for header files. Among others, you should be able to find a path to the directory containing Godot.hpp
.
Make sure it has the correct paths.
For example, mine:
env.Append(CPPPATH = [
'.',
'godot-cpp/godot_headers/',
'godot-cpp/include/',
'godot-cpp/include/core/',
'godot-cpp/include/gen/'
])
And my directory structure:
Note: my SConstruct is separate from the godot-cpp one.
Is this still an issue? Typically this is due to your SConstruct file specifying the wrong path to the C++ bindings.
Same thing, check your include paths. Recently godot-headers
was renamed with a -
instead of an _
so make sure your paths are correct. (see also https://github.com/godotengine/godot-cpp/issues/523)
I'm not seeing a file called Godot.hpp within my folders. There is one named godot.hpp, however. Could this difference in capitalization be part of the reason why I'm getting a similar error?
The answers I gave were for GDNative in Godot 3. This might not apply 1:1 to the master branch which is now GDExtension for Godot 4. But in general if your compiler cannot find a header it is also because of a similar problem: header paths in your build script need a fix to contain the right directories (as when using any C++ library generally)
i dont have any godot.hpp or Godot.hpp file
Hi,
I don't seem to have a "Nativ"-directory. Is that bad? (LoL)
Also I attempted togit copy
the Godot-cpp
repository with Git Bash but it came without headers, so I git copy
the headers repository too, both via http. Is there a better way to do this?
BTW I downloaded the Godot-cpp 4.2-Version and use the Godot 4.2.1-Version. Does that make sense or should I use master branch instead? However I had the exact same problem with master branch.
@mistermeman The headers repository isn't used with Godot 4, that's a Godot 3 thing. The headers are generated as part of the build process, running scons
should automatically generate them.
I'm using GDNative documentation of Godot 3.2 and I'm stuck on this section (Compiling the Plugin): https://docs.godotengine.org/en/3.2/tutorials/plugins/gdnative/gdnative-cpp-example.html#compiling-the-plugin
Here's the build log:
As I compiled with scons, it throws me the error of No such file or directory. I've already generate its bindings including Godot.hpp
I'm using Visual Studio code with this and it can detect Godot.hpp and throws no errors but it throws errors on cmd scons command
I'm I missing something?
In this current section, my new SConstruct file was been combined with the old.