[Clp] problems compiling Clp with gcc/g++ 3.3.5

Kish Shen kisshen at cisco.com
Tue Feb 10 13:16:59 EST 2009


Hi,

As I mentioned in my previous post, I was unable to compile the latest 
trunk branch Cbc, and the problem seem to occur when compiling Clp. I
have since tried compiling Cbc on a x86-64 Linux machine, which has
gcc 4.1, and this compiled without the problem, so I assume it is an 
issue with the gcc version.

The problem occurs when trying to compile unitTest.cpp, apparently in 
line 1978 (see the partial output from the compiler at the end of this 
message). Line 1978 is the line starting with blockName in the following:

     CoinStructuredModel structured;
     int numberBlocks=5;
     for (int i=0;i<numberBlocks;i++) {
       std::string topName="row_master";
       std::string blockName="block_";
       blockName.append(1,'a'+i);
       structured.addBlock(topName,blockName,top);
       structured.addBlock(blockName,blockName,sub);
     }

This code is not in the unitTest.cpp of the Cbc I downloaded on 
2008-11-04, which I was able to compile with gcc 3.3.

I am wondering if it is possible to work around this problem? gcc 3
is still not that old -- two different systems I have access to, and 
which were both set up about 3 to 4 years ago, both have gcc 3 (3.3 and 
3.2) as the gcc compiler. I am not in a position to replace the gcc used 
on these system, and in any case, it would be perferable to be able to 
compile with gcc 3, because the binaries (we distribute in both binary 
and source forms) will run on more machines.

Thanks and cheers,

Kish
======

The (start of) error output by g++ when compiling unitTest.cpp:


if g++ -DHAVE_CONFIG_H -DUFL_BARRIER -I. -I`echo ../../../Clp/src` 
-I../inc  -I`echo /homes/kish/CoinCbcClp20090210/CoinUtils/src` -I`echo 
/homes/kish/CoinCbcClp20090210/i386_linux/Clp/../CoinUtils/inc`   -O2 
-fno-omit-frame-pointer -momit-leaf-frame-pointer -DNDEBUG   -MT 
unitTest.o -MD -MP -MF ".deps/unitTest.Tpo" -c -o unitTest.o 
../../../Clp/src/unitTest.cpp; \
then mv -f ".deps/unitTest.Tpo" ".deps/unitTest.Po"; else rm -f 
".deps/unitTest.Tpo"; exit 1; fi
/usr/include/c++/3.3.5/bits/stl_iterator_base_types.h: In instantiation 
of `std::iterator_traits<int>':
/usr/include/c++/3.3.5/bits/basic_string.h:624:   instantiated from 
`std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, 
_Traits, _Alloc>::replace(__gnu_cxx::__normal_iterator<typename 
_Alloc::pointer, std::basic_string<_CharT, _Traits, _Alloc> >, 
__gnu_cxx::__normal_iterator<typename _Alloc::pointer, 
std::basic_string<_CharT, _Traits, _Alloc> >, _InputIterator, 
_InputIterator) [with _InputIterator = int, _CharT = char, _Traits = 
std::char_traits<char>, _Alloc = std::allocator<char>]'
/usr/include/c++/3.3.5/bits/basic_string.h:492:   instantiated from 
`std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, 
_Traits, _Alloc>::append(_InputIterator, _InputIterator) [with 
_InputIterator = int, _CharT = char, _Traits = std::char_traits<char>, 
_Alloc = std::allocator<char>]'
../../../Clp/src/unitTest.cpp:1978:   instantiated from here
/usr/include/c++/3.3.5/bits/stl_iterator_base_types.h:126: error: `int' 
is not
    a class, struct, or union type
/usr/include/c++/3.3.5/bits/stl_iterator_base_types.h:127: error: `int' 
is not
...etc.

-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.




More information about the Clp mailing list