[odb-users] Include of SQLite files and ODB compiler

Erez Pics picserez at gmail.com
Mon Nov 24 06:07:33 EST 2014


Hi Boris,

[Switched to plain text client, hope it helps]

As you know we are using ODB and are very happy with it.

Following our last correspondence we changed to use explicit SQLite
objects instead of regular ODB ones, for example :
odb::sqlite::database object instead of odb::database
odb::sqlite::connection object instead of odb::connection

This means that we need to change the include accordingly and so forth.

The ODB compiler does not like these includes :
In file included from r:\libodb-sqlite-2.3.0/odb/sqlite/details/export.hxx:10:0,
                 from r:\libodb-sqlite-2.3.0/odb/sqlite/traits.hxx:30,
                 from r:\libodb-sqlite-2.3.0/odb/sqlite/query.hxx:21,
                 from r:\libodb-sqlite-2.3.0/odb/sqlite/database.hxx:22,

r:\libodb-sqlite-2.3.0/odb/sqlite/details/config.hxx:12:4: error:
#error libodb-sqlite header included in odb-compiled header

I used ifndef to make the ODB compiler ignore these includes:
#ifndef ODB_COMPILER
#include <odb/sqlite/database.hxx>
#include <odb/sqlite/connection.hxx>
#include <odb/sqlite/transaction.hxx>
#endif // ODB_COMPILER

Which indeed fixed the error and cause another one, because we are
passing odb::sqlite::database object in our code, it does not know the
sqlite namespace:
 error: 'sqlite' is not a member of 'odb'

How would you recommend to resolve this problem ?

* Create fake odb::sqlite namespace just for ODB compiler ?
* Revert to use ODB general objects ?
* Other solution ?

Thank you very much,
Erez.



More information about the odb-users mailing list