GDExtension vector3.hpp not found.
Asked Answered
B

7

0

I've #include <godot_cpp/core/vector3.hpp>, but it returns this output:

src/hexmap.cpp:4:10: fatal error: godot_cpp/core/math/vector3.hpp: No such file or directory
    4 | #include <godot_cpp/core/math/vector3.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Where is the proper vector3.hpp located?

Benzoic answered 13/10, 2023 at 14:36 Comment(0)
P
1

Benzoic Header files in Godot source have *.h extensions, not *.hpp.

Phenylketonuria answered 13/10, 2023 at 16:51 Comment(0)
B
0

Phenylketonuria That may be true for Godot source, but in GDExtension, the following includes work without throwing an error, and when I tried to change the include for vector3, it didn't work:

#include <godot_cpp/classes/node3d.hpp>

#include <godot_cpp/core/class_db.hpp>
#include <godot_cpp/variant/variant.hpp>
#include <godot_cpp/variant/utility_functions.hpp>
src/hexmap.cpp:4:10: fatal error: godot_cpp/core/math/vector3.h: No such file or directory
    4 | #include <godot_cpp/core/math/vector3.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Benzoic answered 13/10, 2023 at 17:21 Comment(0)
P
0

Benzoic Did you check if the file is actually there? Also make sure the compiler include paths are properly set up.

Phenylketonuria answered 13/10, 2023 at 17:34 Comment(0)
B
0

Apparently you don't need to include files for Vector3's. It compiled just fine when I removed the #include.

Benzoic answered 13/10, 2023 at 17:47 Comment(0)
B
0

Phenylketonuria Do you know if there's any documentation for GDExtension? I'd really like a reference manual.

Benzoic answered 13/10, 2023 at 17:47 Comment(0)
P
0

Benzoic I don't know of anything other than what's in official docs. Imho, that's really enough. If you're up to the task of writing an extension, you're supposed be able to deduce everything you need from peeking into Godot's source code. Luckily, it is very well written. Looking at class interfaces is almost like reading a reference manual 🙂

Phenylketonuria answered 13/10, 2023 at 18:56 Comment(0)
B
0

Ah, yeah haven’t peeked at the source yet. Will do that today.

Benzoic answered 13/10, 2023 at 18:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.