[odb-users] boost date_time link error

Boris Kolpackov boris at codesynthesis.com
Sat May 19 01:24:16 EDT 2012


Hi Craig,

Burton, Craig <crburton at tnsi.com> writes:

> I've never used the Boost libraries before, but I believe that it
> is necessary to do so in order to utilize the Oracle DATE type.

More precisely, ODB provides a mapping of Oracle data-time types
to Boost data_time library (as well as Qt C++ date-time types).
But you can always map Oracle date-time types to some other
suitable C++ data-time representations if desired (see the
'mapping' example in the odb-examples package for details).

Using Boost (or Qt), is probably the easiest way to get started,
thought.


> My quick test seems to compile ok, but fails during link:
>
> [...]
> 
> g++ -lodb -lodb-oracle -lboost_date_time loadNetworkSPData.o NPAC-odb.o
> NPA-odb.o NPACImage-odb.o -o loadNetworkSPData
> 
> Undefined                       first referenced
>  symbol                             in file
> 
> typeinfo for odb::boost::date_time::special_value NPACImage-odb.o
> vtable for odb::boost::date_time::special_value NPACImage-odb.o

>From your ld output I gather you are using Solaris. The most likely
cause of the above error is that Boost date_time was build with Sun
CC wile you are using GCC to build your application. You will need
to use the same compiler for both. You can either use Sun CC to
build your application (and ODB runtime libraries) or you will
need to rebuild Boost using GCC. For more information on how to
do this, see the Section 5.3, "Or, Build Custom Binaries" in
Boost getting started guide (you will need to use 'gcc' as the
toolchain):

http://www.boost.org/doc/libs/1_49_0/more/getting_started/unix-variants.html#or-build-custom-binaries

Boris



More information about the odb-users mailing list