[Coin-discuss] Problems compiling Coin utilities with gcc 2.95 and 2.96
Ted Ralphs
tkralphs at lehigh.edu
Mon Nov 1 14:28:53 EST 2004
I just discovered that the Coin utility library does not compile with
gcc versions 2.95 or 2.96 (Redhat). I installed version 3.4.2 (the
latest release) and it does compile with that one. I'm not sure about
versions in between. The problem is a name conflict with the declaration
of the STL algorithm "swap." CoinPresolveMatrix.hpp also declares a swap
method. I'm not sure exactly why it compiles in later version of gcc,
since this still appears to be a conflict. The error message is
appended below.
I don't know exactly what versions of gcc we intend to support, but in
any case, we should probably avoid conflicts with names that are used in
the STL. It probably makes sense to change the name of the swap method
in CoinPostsolveMatrix.hpp to something else.
Cheers,
Ted
==================================================================
In file included from CoinPostsolveMatrix.cpp:10:
include/CoinPresolveMatrix.hpp:1642: redefinition of `template <class T>
void swap(T &, T &)'
/usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/../../../../include/g++-3/stl_algobase.h:76:
`template <class _Tp> void swap(_Tp &, _Tp &)' previously declared here
include/CoinPresolveMatrix.hpp:1642: redefinition of `void swap(T &, T &)'
/usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/../../../../include/g++-3/stl_algobase.h:76:
`void swap(_Tp &, _Tp &)' previously defined here
make[1]: *** [Linux-g/CoinPostsolveMatrix.o] Error 1
make[1]: Leaving directory `/home2/tkr/COIN/Coin'
make: *** [install] Error 2
--
Dr. Ted Ralphs
Assistant Professor
Industrial and Systems Engineering
Lehigh University
(610)758-4784
tkralphs at lehigh.edu
www.lehigh.edu/~tkr2
"An optimist is someone who thinks
'It doesn't get any better than this.'
A pessimist is someone who's afraid that's true."
More information about the Coin-discuss
mailing list