[odb-users] RE: ixx: error: no matching function for call to ?odb::access::object_traits<Base>::id(const object_type&)?

Richard Topolewski topolewr at cooley.edu
Tue Nov 7 06:47:17 EST 2017


> I don't understand is why the compiling of a derived class
> complains it can’t find some ODB functions that it needs regarding the
base
> class?
> I have a base class Base.cpp with #pragma db object polymorphic
> and derived class is Base_plus.cpp with #pragma db object
> when compiling Base_plus.cpp  it gives these error:
...
> In file included from Base-odb.hxx:332:0,
>               from Base_plus-odb.hxx:22,
>               from Base_plus.h:25,
>               from Base_plus.cpp:11:
> Base-odb.ixx:12:3: note: candidate: static
> odb::access::object_traits<Base>::id_type
> odb::access::object_traits<Base>::id(const object_type&)
> access::object_traits< ::Base >::

> Base-odb.ixx:12:3: note:   no known conversion for argument 1 from ‘const
> object_type {aka const Base_plus}’ to ‘const object_type& {aka const
Base&}’

I was able to resolve this by moving the include of the Base-odb.hxx and
the Base-plus-odb.hxx to the bottom of my header file.  I believe I had a
forward class definition (i.e. "class Base;") as opposed to the complete
class definition at the point where the -odb.hxx was being included that
was causing problems.  Moving the include till after the header definition
of the class seemed to resolve the issue.


More information about the odb-users mailing list