[odb-users] Sections in view's result causes exception

Lukas Obermann obermann.lukas at gmail.com
Mon Dec 26 08:16:18 EST 2016


Hi Boris,

ok, I did remove everything not needed until it started to work, and then added in one part after another.

While not yet being able to reproduce the initial issue I had yet, I came across something that may relate to it.
The odb::unknown_schema exception is thrown when first creating a library out of the odb files and then linking it to the main, but only when —multi-database dynamic is enabled. When compiling everything at once, without the library step, it does not throw the exception.


So, with the code in the repo, with the following commands it works:

/usr/bin/odb --multi-database dynamic -d sqlite -d common --generate-query --generate-session --generate-schema --generate-prepared --std c++11 --schema-format embedded -I/usr/local/include ODBData.h
/usr/bin/odb --multi-database dynamic -d sqlite -d common  --generate-query --generate-session --generate-schema --generate-prepared --std c++11 --schema-format embedded -I/usr/local/include ODBFile.h

/usr/bin/c++ -std=gnu++11 -o ODBFile-odb.cxx.o -c ODBFile-odb.cxx
/usr/bin/c++ -std=gnu++11 -o ODBFile-odb-sqlite.cxx.o -c ODBFile-odb-sqlite.cxx
/usr/bin/c++ -std=gnu++11 -o ODBData-odb.cxx.o -c ODBData-odb.cxx
/usr/bin/c++ -std=gnu++11 -o ODBData-odb-sqlite.cxx.o -c ODBData-odb-sqlite.cxx
/usr/bin/c++ -std=gnu++11 -o main.cpp.o -c main.cpp
/usr/bin/c++ main.cpp.o  ODBFile-odb.cxx.o ODBFile-odb-sqlite.cxx.o ODBData-odb.cxx.o ODBData-odb-sqlite.cxx.o -lodb -lodb-sqlite -lsqlite3



And the with the following it throws an odb::unknown_schema exception:

/usr/bin/odb --multi-database dynamic -d sqlite -d common --generate-query --generate-session --generate-schema --generate-prepared --std c++11 --schema-format embedded -I/usr/local/include ODBData.h
/usr/bin/odb --multi-database dynamic -d sqlite -d common  --generate-query --generate-session --generate-schema --generate-prepared --std c++11 --schema-format embedded -I/usr/local/include ODBFile.h

/usr/bin/c++ -std=gnu++11 -o ODBFile-odb.cxx.o -c ODBFile-odb.cxx
/usr/bin/c++ -std=gnu++11 -o ODBFile-odb-sqlite.cxx.o -c ODBFile-odb-sqlite.cxx
/usr/bin/c++ -std=gnu++11 -o ODBData-odb.cxx.o -c ODBData-odb.cxx
/usr/bin/c++ -std=gnu++11 -o ODBData-odb-sqlite.cxx.o -c ODBData-odb-sqlite.cxx

/usr/bin/ar qc libodb_binding.a ODBFile-odb.cxx.o ODBFile-odb-sqlite.cxx.o ODBData-odb.cxx.o ODBData-odb-sqlite.cxx.o

/usr/bin/c++ -std=gnu++11 -o main.cpp.o -c main.cpp
/usr/bin/c++ main.cpp.o libodb_binding.a -lodb -lodb-sqlite -lsqlite3


I assume that this relates to the other exception that is thrown in the main program.
Do you have an idea what could be happening here?

Thanks,
Lukas



> Am 26.12.2016 um 08:29 schrieb Boris Kolpackov <boris at codesynthesis.com>:
> 
> Hi Lukas,
> 
> I would suggest that you try to simplify your test by getting rid of
> everything non-essential: CMake, multi-database support, etc. Ideally,
> what I would like to get is a header file, a source file (with main()),
> and the ODB command line you used to compile the header.
> 
> Boris




More information about the odb-users mailing list