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

WA van Doesburg wvandoesburg at gmail.com
Wed Sep 3 08:57:37 EDT 2014


Hi Boris,

I’m a little further along in pinpointing what is causing this.

I’m using cmake as my build system. In order to only have to change my code and not my CMakeList.txt each time I add a persistable class I’m including the generated -odb.cxx files to my own .cxx files where I’m using that class.

Apparently this produces the name clash.

So the my question is why is this producing the name clash? And, is there a way to automatically update my CMakeList.txt based on the output of my ODB build step?

If desired I can prepare a sample test case.

Best regards,
— Willem

On 03 Sep 2014, at 09:35, Boris Kolpackov <boris at codesynthesis.com> wrote:

> Hi Willem,
> 
> WA van Doesburg <wvandoesburg at gmail.com> writes:
> 
>> I’ve checked the generated code. The function signature is indeed
>> 
>> static bool
>> create_schema (...)
>> 
>> My platform is Ubuntu 12.04 and my compiler version is:
>> c++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
> 
> Ok, you are using a fairly recent GCC. I searched for any issues/bugs
> with static functions but there doesn't seem to be any. So this is
> probably not the compiler.
> 
> Can you try/do the following for me:
> 
> 1. Add these three lines into one of the generated -odb.cxx files that
>   cause the conflict and try to build (don't re-build so that that
>   there is no run of the ODB compiler since that would overwrite your
>   modifications). 
> 
>   Add them just before the create_schema() function:
> 
> #ifdef static
> #error static is defined as a macro
> #endif
> 
> 2. Can you show me the list of headers you are compiling with ODB. That
>   is the ${ODB_HEADERS} expansion in this:
> 
>   odb -d sqlite -DDATABASE_SQLITE -I../libs/libodb-boost-2.3.0 -o .. \
> --generate-schema --generate-query --profile boost ${ODB_HEADERS}
> 
>   Or, better yet, show the actual ODB command line that gets executed.
> 
> 3. Can you show the linker command line and the complete error listing?
> 
> Thanks,
> Boris




More information about the odb-users mailing list