[odb-users] Incompatible ODB compiler and runtime version

Boris Kolpackov boris at codesynthesis.com
Fri Feb 15 02:49:22 EST 2013


Hi Peter,

Durkan, Peter <PDurkan at cantor.com> writes:

> I just updated to the latest version and am not getting errors as in 
> the subject when trying to build my project -
> 
> "<standard-odb-prologue>:4:4: error: #error incompatible ODB compiler and runtime versions"

This means that the ODB compiler somehow picks up an older/newer version
of libodb. The best way to diagnose this problem is to run the ODB compiler
with the -v option. This will trigger a lot of extra information being
printed by the ODB compiler, but what we are interested in is the include
search paths and their order. Specifically, look for a block of lines
around the line that reads "#include "..." search starts here:".

For example, if I run this on my box:

$ odb -v -d mysql test.hxx

The chunk of lines that we are interested in looks like this:

ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.6
 /usr/include/c++/4.6/x86_64-linux-gnu/.
 /usr/include/c++/4.6/backward
 /usr/lib/gcc/x86_64-linux-gnu/4.6/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.

First, if you have any "ignoring nonexistent directory" lines, make
sure none of the directories mentioned are where you think up-to-date
libodb is installed. For example, you might have specified the libodb
directory with -I but misspelled it.

Next, examine all the directories after the "#include <...> search starts
here" line in order (this is the order in which ODB will examine them).
Look for the odb/version.hxx file in each. Once found, open it and check
the ODB_VERSION_STR macro. It should be the same as the first two components
(major and minor) of the ODB compiler version as printed with odb --version.

For example, in my case, odb/version.hxx is found in /usr/local/include
and its ODB_VERSION_STR is "2.2", which matches the 2.2.0 ODB compiler
version.

Let us know how it goes.

Boris



More information about the odb-users mailing list