[odb-users] Includes missing when defining view of polymorphic type in separate file

Marcel Nehring mne at qosmotec.com
Wed Apr 8 11:28:54 EDT 2015


Hi Boris,

I am getting a compile error in VS12 that seems to be caused by missing includes in an ODB generated file.

The missing directives seem to be

#include <odb/polymorphic-map.hxx>
#include <odb/oracle/polymorphic-object-statements.hxx>
#include <odb/oracle/polymorphic-object-result.hxx>

I can reproduce the issue in a small example when I define an ODB polymorphic Base class (Base) and a class derived from it (Derived) in their own files. Then, when I define an ODB view in a third file, the ODB compiler runs successfully but the produced result causes compile errors
C2027 for odb::polymorphic_map<odb::access::object_traits<Test::Base>::object_type> and odb::oracle::polymorphic_derived_object_statements<odb::access::object_traits<Test::Derived>::object_type>.
If I manually add the three include directives mentioned above to the ODB generated file in question everything seems to work fine. The problem does not occur if the view is defined in the same file as Derived.

Am I missing something?

Regards,
                Marcel


More information about the odb-users mailing list