[odb-users] problem to create library with odb

Boris Kolpackov boris at codesynthesis.com
Tue Jul 2 03:32:17 EDT 2013


Hi Lidia,

Lidia Kalinovsky <lidia at lemur-soft.com> writes:

> 1. Create empty library project and copy all files from some provided with
> odb example ( relationship-sqlite ).

Is it a static or dynamic (DLL) library? I assume you also copied the
generated files (*-odb.?xx) as is? Is the build for Windows RT?


> I get odb::unknown_schema exception from create_database function.
> 
> If I include all *.cxx files generated by odb compiler to the the calling
> application project, everything is fine.

The schema registration code uses static initialization which appears
not to be called in your application. One common case where this happens
is static libraries. This post explains why it won't work out of the box:

http://www.codesynthesis.com/pipermail/odb-users/2013-May/001286.html

And this followup explains how to make it work with VS:

http://www.codesynthesis.com/pipermail/odb-users/2013-May/001289.html

Boris



More information about the odb-users mailing list