[odb-users] Error in compile
Boris Kolpackov
boris at codesynthesis.com
Sat Sep 13 17:24:01 EDT 2014
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