[odb-users] Polymorphism with multiple header files

Boris Kolpackov boris at codesynthesis.com
Mon Dec 4 08:04:18 EST 2017


Konstantin Cherenkov <k.cherenkov at gmail.com> writes:

> Unfortunately, when I am splitting classes into different header files I
> get an error `no_type_info`.
> 
> For example, if I will extract `contractor` class into separate header file
> `contractor.hpp` then I will see this error.
> 
> Is it possible to use polymorphic classes with multiple headers files?

Yes, of course. My guess would be:

1. You did not compile contractor.hpp with the ODB compiler.

2. You did not compile and link the resulting contractor-odb.cpp
   into your application.

3. You packaged contractor-odb.cpp into a static library and since
   you did not reference contractor in your application, it did not
   get linked.

For (3), see:

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

Boris



More information about the odb-users mailing list