[odb-users] Error when migrating or adding headers with ODB markings

Szumowski, Thomas thomas.szumowski at lmco.com
Thu Jun 23 16:46:51 EDT 2011


I noticed that occasionally if I add header files to a project, change the name of a header (and regenerate the ODB files), or change the class names, I tend to get the error below. I can provide the exact source code that causes the error, but before that, any ideas why this may be occurring or what the error is indicating?

In particular, it occurs on the db->persist(..) command. If I comment it out, the error disappears.


ERROR START:


1>------ Build started: Project: relationship-sqlite-vc10, Configuration: Debug Win32 ------
1>  employee-odb.cxx
1>  driver.cxx
1>c:\util\libodb\odb\database.ixx(85): error C2440: 'initializing' : cannot convert from 'const std::tr1::shared_ptr<_Ty>' to 'const object_pointer &'
1>          with
1>          [
1>              _Ty=employee
1>          ]
1>          Reason: cannot convert from 'const std::tr1::shared_ptr<_Ty>' to 'const object_pointer'
1>          with
1>          [
1>              _Ty=employee
1>          ]
1>          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>          c:\util\libodb\odb\database.ixx(95) : see reference to function template instantiation 'void odb::database::update<employee,std::tr1::shared_ptr>(const std::tr1::shared_ptr<_Ty> &)' being compiled
1>          with
1>          [
1>              _Ty=employee
1>          ]
1>          c:\tszumows\projects\o2\code\odb_feature_test\driver.cxx(47) : see reference to function template instantiation 'void odb::database::update<employee,std::tr1::shared_ptr>(std::tr1::shared_ptr<_Ty> &)' being compiled
1>          with
1>          [
1>              _Ty=employee
1>          ]
1>c:\util\libodb\odb\database.ixx(40): error C2440: 'initializing' : cannot convert from 'const std::tr1::shared_ptr<_Ty>' to 'const object_pointer &'
1>          with
1>          [
1>              _Ty=employee
1>          ]
1>          Reason: cannot convert from 'const std::tr1::shared_ptr<_Ty>' to 'const object_pointer'
1>          with
1>          [
1>              _Ty=employee
1>          ]
1>          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>          c:\util\libodb\odb\database.ixx(50) : see reference to function template instantiation 'odb::access::object_traits<employee>::id_type odb::database::persist<employee,std::tr1::shared_ptr>(const std::tr1::shared_ptr<_Ty> &)' being compiled
1>          with
1>          [
1>              _Ty=employee
1>          ]
1>          c:\tszumows\projects\o2\code\odb_feature_test\driver.cxx(50) : see reference to function template instantiation 'odb::access::object_traits<employee>::id_type odb::database::persist<employee,std::tr1::shared_ptr>(std::tr1::shared_ptr<_Ty> &)' being compiled
1>          with
1>          [
1>              _Ty=employee
1>          ]
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


More information about the odb-users mailing list