[odb-users] Re: when running odb compiler get error "#error libodb-mysql header included in odb-compiled header" (Typos fixed)

Richard Topolewski topolewr at cooley.edu
Tue Oct 24 06:29:20 EDT 2017


Fixed some typos:
I got odb complier to work on myClass1 to create myClass1-odb.hxx,
myClass1.sql, myClass1-odb.cxx, and myClass1-odb.ixx.

I then modified useingClass to persist a vector of myClass1s, and also load
the set of myClass1s from the database. All really cool.

Then I started working on myClass2.  When I went to run the odb complier on
myClass2 it has some errors because myClass2 depends on a number other
packages. Ok, resolved all those errors but then end up with this error:

In file included from /usr/include/odb/mysql/version.hxx:10:0,
from myClass1-odb.hxx:83,
from usingClass.h:24,
from myClass2.h:10:
:/usr/include/odb/mysql/details/config.hxx:15:4: error: #error libodb-mysql
header included in odb-compiled header

Turns out myClass2 has a member variable that is a usingClass pointer that
includes the member vector array of myClass1s.

The odb complier command I am using is:
odb -I/usr/include/odblib --std c++14 $(INCLUDES) -d mysql --generate-query
myClass2.h

What am I doing wrong? Do I need to structure my classes in a different
way? Is there some pragma I should be using to fix this? Should I not be
creating the db object in usingClass?  Is there some part of the odb manual
I should be looking at?

If there is any additional information I need to provide please let me know.

Rich Topolewski

On Mon, Oct 23, 2017 at 7:31 PM, Richard Topolewski <topolewr at cooley.edu>
wrote:

>
> I got odb or myClass1 to create the myClass1-odb.hxx, myClass1.sql,
> myClass1-odb.cxx, myClass1-odb.ixx.
>
> I then modified useingClass to use persist my set of myClass1s, and also
> load the set of myClass1s from the database. Cool.
>
> Then I started working on myClass2.  When I went to run the odb complier
> it has some errors because myClass2 depends on a number other packages.
> Ok, resolved all those errors but then end up with an error:
>
> In file included from /usr/include/odb/mysql/version.hxx:10:0,
> from myClass1-odb.hxx:83,
> from usingClass.h:24,
> from myClass2.h:10:
> :/usr/include/odb/mysql/details/config.hxx:15:4: error: #error
> libodb-mysql header included in odb-compiled header
>
> Turns out myClass2 includes a member pointer to usingClass which includes
> the member vector array of myClass1s then includes
>
> The odb complier command I am using is:
> odb -I/usr/include/odblib --std c++14 $(INCLUDES) -d mysql
> --generate-query myClass2.h
>
> What am I doing wrong? Do I need to not structure my classes this way?
> Should I not be creating the db object in usingClass?  Is there some part
> of the odb manual I should be looking at?
>
> If there is any additional information I need to provide please let me
> know.
>
> Rich Topolewski
>


More information about the odb-users mailing list