[odb-users] Segmentation fault while executing odb compiler
avoided adding a typedef sentence
MM
finjulhich at gmail.com
Fri Sep 4 16:40:29 EDT 2015
On 4 September 2015 at 14:31, Boris Kolpackov <boris at codesynthesis.com>
wrote:
> MM <finjulhich at gmail.com> writes:
>
> > Please find attached 5 c++ files.
>
> Thanks for the test. The problem is again with the order in which
> ODB "sees" C++ classes. I've added some more diagnostics (available
> in master) with which your test case produces:
>
> derived.hpp:4:8: error: base class derived_from_base must be defined
> before derived class Derived
> derived_odb.hpp:5:12: info: class derived_from_base is define here
>
> I've re-arranged the order of things in your derived_odb.hpp to be:
>
> #include "base_odb.hpp"
>
> #include "cloneable.hpp"
> struct Derived;
> using derived_from_base = cloneable<Base,Derived>;
> #pragma db object(derived_from_base) abstract definition
>
> #include "derived.hpp"
> #pragma db object(Derived) table("TD") definition
>
> That and adding '#pragma once' to cloneable.hpp fixes the error and
> even produces compilable code.
>
> If you meditate on it, the order in which things are now included/defined
> actually makes quite a bit of sense.
>
> Boris
>
Indeed, reordering fixes the odb compiler crash. My executable builds.
Post successful link, I generate the sql once with odb.
I have the following snippet that tries to adapt
boost::gregorian::date_period as I don't see it in the profile..
namespace boost
{
namespace gregorian
{
#pragma db value(date_period) transient definition
#pragma db member(date_period::begin) virtual(date) get(begin())\
set(this = ::boost::gregorian::date_period((?), this.end()))
#pragma db member(date_period::end) virtual(date) get(end())\
set(this = ::boost::gregorian::date_period(this.begin(), (?)))
}
}
odb barks for the same reason:-)
Is this why only date is in the boost/date_time subprofile :-)
Any workaround you think of? My onw wrapper class around date_period?
Thanks
MM
More information about the odb-users
mailing list