[odb-users] Re: Possible #include bug in generated code

Per Edin info at peredin.com
Sun Sep 1 15:53:46 EDT 2013


I meant --schema-prologue of course.

On Sun, Sep 1, 2013 at 8:59 PM, Per Edin <info at peredin.com> wrote:
> Hi,
>
> When generating the schema separately in a static multi-database
> configuration the generated schema source file does not compile. The
> compiler gives an error about the "invalid use of incomplete type
> class odb::database'.
>
> I discovered that in static mode the generated inline file
> person-odb.ixx omits to include odb/database.hxx. In dynamic mode the
> #include-line is present.
>
> A workaround is to use --cxx-prologue but a long-term solution would
> be to make the odb compiler emit
>
>     #include <odb/database.hxx>
>
> to the top of person-schema-DB.cxx file directly.
>
> ODB commands used:
>
> odb --generate-schema --schema-format separate --std c++11 -m static
> -d common -d pgsql person.hxx
>
> odb --generate-schema --schema-format separate --std c++11 -m dynamic
> -d common -d pgsql person.hxx
>
> Replace pgsql with sqlite and the problem remains. None of the
> separately generated schema source files include odb/database.hxx on
> their own.
>
> /Per



More information about the odb-users mailing list