[odb-users] Error in compile

nima chavooshi nima0102 at gmail.com
Sun Sep 14 13:04:50 EDT 2014


Dear Boris,

Thanks for your reply. But I have defined a default constructor. I attached
the header of classes.

On Sun, Sep 14, 2014 at 1:54 AM, Boris Kolpackov <boris at codesynthesis.com>
wrote:

> Hi Nima,
>
> nima chavooshi <nima0102 at gmail.com> writes:
>
> > /usr/local/include/odb/database.ixx:570:54: error: no matching function
> for
> > call to 'odb::object_traits_impl<Contact,
> > (odb::database_id)0u>::find(odb::database&, const id_type&)'
>
> If you look at the line of code that this error points to, just above
> it you will see this comment:
>
>     // Compiler error pointing here? Perhaps the object doesn't have the
>     // default constructor?
>     //
>
> Looking at your Contact class, it indeed doesn't have a default
> constructor. When you add it, you can make it private since you
> have a friend declaration.
>
> You can read more on this requirement in Section 3.2, "Declaring
> Persistent Objects and Values" in the ODB manual.
>
> Boris
>


More information about the odb-users mailing list