如何在 flatbuffers 中使用 "navtive_type"?

how to use "navtive_type" in flatbuffers?

这是我的测试模式:

native_include "mystruct.h"
table testdata
{
    data:mystruct (native_type);
}

flatc 显示:错误:期待:table 而不是得到:标识符:native_include.

我在 flatbuffers 文档中找不到有关如何使用 native_type 的任何详细信息。

拜托,谁能告诉我一些例子如何使用,我应该写在哪里"namespace flatbuffers { FlatbufferStruct Pack(const native_type& obj); native_type UnPack(const FlatbufferStruct& obj); }"

非常感谢!

native_include 应该被解析,如果它认为它是一个标识符,你可能使用了旧版本的 flatc ?

至于 native_type,这是结构的属性,而不是字段,例如:struct mystruct (native_type: "mycpptype") { .. },如此处的文档所示:https://google.github.io/flatbuffers/flatbuffers_guide_use_cpp.html