Hi,

I have some software that uses the BOOST matrix library UBLAS (1.33.1). With GCC 4.1.1 this software compile fine (Debian Linux system - GNU ld). However, with GCC 4.2 I get lots of errors, but I am not sure if this is a bug or not:

substitution.o:(.data+0x0): multiple definition of `_ZN5boost7numeric5ublas21scalar_divides_assignIT_T0_E8computedE'
alignment.o:(.data+0x0): first defined here

This is from the definition of a static const member of a template class in boost/numeric/ublas/functional.hpp:

template<class T1, class T2>
struct scalar_divides_assign:
public scalar_binary_assign_functor<T1, T2> {
      ... stuff ...
};

template<class T1, class T2>
const bool scalar_divides_assign<T1,T2>::computed = true;

For some reason, GCC 4.2, but not 4.1 actually emits this constant in the global data section. With 4.2:

$ nm alignment.o | grep divides
0000000000000180 t _GLOBAL__I__ZN5boost7numeric5ublas21scalar_divides_assignIT_T0_E8computedE 0000000000000000 D _ZN5boost7numeric5ublas21scalar_divides_assignIT_T0_E8computedE

With 4.1 neither of these two symbols (or is it one symbol, mentioned twice?) is emitted.

So, is this a non-bug, or should I submit this to bugzilla?

thanks!

-BenRI

Reply via email to