Skip to content

[C++] flatc doesn't create a working _generated.h file #7162

@Fokson

Description

@Fokson

Attempted to follow the tutorial provided, using the monster.fbs schema and the newest compiled binary release of flatc ( 1.12 / 2.0 ).

The generated file is under half of the size of the example provided in the repo:
image

The monster_generated.h file created by flatc doesn't compile, giving the error "no matching function for call to 'MyGame::Sample::Monster::VerifyFieldMyGame::Sample::Vec3(flatbuffers::Verifier&, MyGame::Sample::Monster::FlatBuffersVTableOffset) const', candidate expects 3 arguments, 2 provided"

Full log pasted below:
||=== Build: Debug in FlatBufferTest (compiler: GNU GCC Compiler) ===| FlatBufferTest\monster_generated.h||In member function 'bool MyGame::Sample::Monster::Verify(flatbuffers::Verifier&) const':| FlatBufferTest\monster_generated.h|173|error: no matching function for call to 'MyGame::Sample::Monster::VerifyField<MyGame::Sample::Vec3>(flatbuffers::Verifier&, MyGame::Sample::Monster::FlatBuffersVTableOffset) const'| .\flatbuffers\table.h|115|note: candidate: template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const| .\flatbuffers\table.h|115|note: template argument deduction/substitution failed:| FlatBufferTest\monster_generated.h|173|note: candidate expects 3 arguments, 2 provided| FlatBufferTest\monster_generated.h|174|error: no matching function for call to 'MyGame::Sample::Monster::VerifyField<int16_t>(flatbuffers::Verifier&, MyGame::Sample::Monster::FlatBuffersVTableOffset) const'| .\flatbuffers\table.h|115|note: candidate: template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const| .\flatbuffers\table.h|115|note: template argument deduction/substitution failed:| FlatBufferTest\monster_generated.h|174|note: candidate expects 3 arguments, 2 provided| FlatBufferTest\monster_generated.h|175|error: no matching function for call to 'MyGame::Sample::Monster::VerifyField<int16_t>(flatbuffers::Verifier&, MyGame::Sample::Monster::FlatBuffersVTableOffset) const'| .\flatbuffers\table.h|115|note: candidate: template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const| .\flatbuffers\table.h|115|note: template argument deduction/substitution failed:| FlatBufferTest\monster_generated.h|175|note: candidate expects 3 arguments, 2 provided| FlatBufferTest\monster_generated.h|180|error: no matching function for call to 'MyGame::Sample::Monster::VerifyField<int8_t>(flatbuffers::Verifier&, MyGame::Sample::Monster::FlatBuffersVTableOffset) const'| .\flatbuffers\table.h|115|note: candidate: template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const| .\flatbuffers\table.h|115|note: template argument deduction/substitution failed:| FlatBufferTest\monster_generated.h|180|note: candidate expects 3 arguments, 2 provided| FlatBufferTest\monster_generated.h|184|error: no matching function for call to 'MyGame::Sample::Monster::VerifyField<uint8_t>(flatbuffers::Verifier&, MyGame::Sample::Monster::FlatBuffersVTableOffset) const'| .\flatbuffers\table.h|115|note: candidate: template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const| .\flatbuffers\table.h|115|note: template argument deduction/substitution failed:| FlatBufferTest\monster_generated.h|184|note: candidate expects 3 arguments, 2 provided| FlatBufferTest\monster_generated.h||In member function 'bool MyGame::Sample::Weapon::Verify(flatbuffers::Verifier&) const':| FlatBufferTest\monster_generated.h|314|error: no matching function for call to 'MyGame::Sample::Weapon::VerifyField<int16_t>(flatbuffers::Verifier&, MyGame::Sample::Weapon::FlatBuffersVTableOffset) const'| .\flatbuffers\table.h|115|note: candidate: template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const| .\flatbuffers\table.h|115|note: template argument deduction/substitution failed:| FlatBufferTest\monster_generated.h|314|note: candidate expects 3 arguments, 2 provided| ||=== Build failed: 6 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

Others schemas besides the example fail similarly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions