[odb-users] Segmentation fault while executing odb compiler avoided adding a typedef sentence

Boris Kolpackov boris at codesynthesis.com
Fri Sep 4 09:31:47 EDT 2015


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



More information about the odb-users mailing list