Boost logo

Boost :

From: Kresimir Fresl (fresl_at_[hidden])
Date: 2002-03-27 05:44:57

Peter Schmitteckert (boost) wrote:

> It seems that
> double numerics::detail::conj(double const& x)
> is missing somewhere.
[...]> $ g++-3.0 -I ../.. -DUSE_GCC u.C -o u
> /tmp/cc95hlYg.o: In function
> `numerics::scalar_conj<double>::operator()(double const&) const':
> /tmp/cc95hlYg.o(.gnu.linkonce.t._ZNK8numerics11scalar_conjIdEclERKd+0xd):
> undefined reference to `numerics::detail::conj(double const&)'
> collect2: ld returned 1 exit status

Some time ago I stumbled upon the same problem (although
it wasn't `conj()', but some other function declared/defined
in `ublas/math.h').

Relevant lines from `ublas/config.h':

    #ifdef USE_GCC
    // ...
    #ifdef NDEBUG
    // ...
    // ...
    // ...

That is, if you do not define NDEBUG, then
NUMERICS_USE_INSTANT is defined. And this
means that some (all?) functions from `ublas/math.h'
(eg. `conj()') will not be inlined. Instead, you
should compile and link `ublas/instant.cpp':

   g++-3.0 -I ../.. -DUSE_GCC u.C your_ublas_path/instant.cpp -o u

The alternative is to define NDEBUG:

   g++-3.0 -I ../.. -DNDEBUG -DUSE_GCC u.C

BTW, without NDEBUG you will not get true expression
templates because

    #define NUMERICS_USE_ET

is in #ifdef NDEBUG block.



Boost list run by bdawes at, gregod at, cpdaniel at, john at