Calling create_convex_shape on arraymesh in gdnative cpp gives error

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jujumumu

I am doing this all in gdnative with c++. When I make a arraymesh then call create_convex_shape on it I get an error which is “error: member access into incomplete type ‘godot::Shape’”
A simple version of the code is below:

ArrayMesh *amesh = ArrayMesh::_new();
Array vertexarray;
Array arrays;
arrays[ArrayMesh::ARRAY_VERTEX] = vertexarray;
amesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES, arrays);

I get the same error. How do I fix this?

:bust_in_silhouette: Reply From: sash-rc

error: member access into incomplete type ‘godot::Shape’

Such errors almost always means you missed include, in particular, you need

#include <Shape.hpp>