[odb-users] error: redefinition of ‘bool odb::create_schema

WA van Doesburg wvandoesburg at gmail.com
Sun Aug 31 16:12:05 EDT 2014


Hi,

I’m trying to build a program using ODB 2.3.0 and SQLITE3 where each persistable class is defined in it’s own header file.

I’m compiling all header files using the command:
odb -d sqlite -DDATABASE_SQLITE -I../libs/libodb-boost-2.3.0 -o .. --generate-schema --generate-query --profile boost ${ODB_HEADERS}

This results in the expected .hxx, .cxx and .ixx files.

When linking my program I’m getting the error:
error: redefinition of ‘bool odb::create_schema
the compiler is citing two different -odb.cxx files both defining this function.

It seems to me that ODB generates code that creates a odb::create_schema() function for each header file. This of course results in a name clash. How can I get around this (besides using only one header file)?

Wouldn’t it be better if ODB generated the create_schema() function in header specific namespaces?

Best regards,
— Willem



More information about the odb-users mailing list