<html><body>
<p>Thanks for pointing out the mistake.<br>
<br>
<img width="16" height="16" src="cid:1__=0ABBFFC9DFA609918f9e8a93df938@us.ibm.com" border="0" alt="Inactive hide details for Michael Hennebry ---02/11/2009 12:52:28 AM---On Tue, 10 Feb 2009, Kish Shen wrote:"><font color="#424282">Michael Hennebry ---02/11/2009 12:52:28 AM---On Tue, 10 Feb 2009, Kish Shen wrote:</font><br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFFC9DFA609918f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">From:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFFC9DFA609918f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu></font></td></tr>
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFFC9DFA609918f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">To:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFFC9DFA609918f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">Kish Shen <kisshen@cisco.com></font></td></tr>
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFFC9DFA609918f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Cc:</font></td><td width="100%" valign="middle"><img width="1" height="1" src="cid:2__=0ABBFFC9DFA609918f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">clp@list.coin-or.org</font></td></tr>
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFFC9DFA609918f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Date:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFFC9DFA609918f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">02/11/2009 12:52 AM</font></td></tr>
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFFC9DFA609918f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Subject:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFFC9DFA609918f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">Re: [Clp] problems compiling Clp with gcc/g++ 3.3.5</font></td></tr>
</table>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt>On Tue, 10 Feb 2009, Kish Shen wrote:<br>
<br>
> As I mentioned in my previous post, I was unable to compile the latest<br>
> trunk branch Cbc, and the problem seem to occur when compiling Clp. I<br>
> have since tried compiling Cbc on a x86-64 Linux machine, which has<br>
> gcc 4.1, and this compiled without the problem, so I assume it is an<br>
> issue with the gcc version.<br>
<br>
Though the message isn't very good, I think the code is in error.<br>
<br>
> The problem occurs when trying to compile unitTest.cpp, apparently in<br>
> line 1978 (see the partial output from the compiler at the end of this<br>
> message). Line 1978 is the line starting with blockName in the following:<br>
><br>
> CoinStructuredModel structured;<br>
> int numberBlocks=5;<br>
> for (int i=0;i<numberBlocks;i++) {<br>
> std::string topName="row_master";<br>
> std::string blockName="block_";<br>
> blockName.append(1,'a'+i);<br>
<br>
'a'+1 is an int, but is probably intended to be a char.<br>
append is rather overloaded.<br>
I think that int to char is not one of the<br>
allowed conversions for overload resolution.<br>
None of the non-template methods matched,<br>
so the compiler inferred you wanted a template method,<br>
but that didn't match either.<br>
As the last thing tried, it got mentioned in the error message.<br>
<br>
An explicit cast should fix it.<br>
<br>
> structured.addBlock(topName,blockName,top);<br>
> structured.addBlock(blockName,blockName,sub);<br>
> }<br>
><br>
> This code is not in the unitTest.cpp of the Cbc I downloaded on<br>
> 2008-11-04, which I was able to compile with gcc 3.3.<br>
><br>
> I am wondering if it is possible to work around this problem? gcc 3<br>
> is still not that old -- two different systems I have access to, and<br>
> which were both set up about 3 to 4 years ago, both have gcc 3 (3.3 and<br>
> 3.2) as the gcc compiler. I am not in a position to replace the gcc used<br>
> on these system, and in any case, it would be perferable to be able to<br>
> compile with gcc 3, because the binaries (we distribute in both binary<br>
> and source forms) will run on more machines.<br>
><br>
> Thanks and cheers,<br>
><br>
> Kish<br>
> ======<br>
><br>
> The (start of) error output by g++ when compiling unitTest.cpp:<br>
><br>
><br>
> if g++ -DHAVE_CONFIG_H -DUFL_BARRIER -I. -I`echo ../../../Clp/src`<br>
> -I../inc -I`echo /homes/kish/CoinCbcClp20090210/CoinUtils/src` -I`echo<br>
> /homes/kish/CoinCbcClp20090210/i386_linux/Clp/../CoinUtils/inc` -O2<br>
> -fno-omit-frame-pointer -momit-leaf-frame-pointer -DNDEBUG -MT<br>
> unitTest.o -MD -MP -MF ".deps/unitTest.Tpo" -c -o unitTest.o<br>
> ../../../Clp/src/unitTest.cpp; \<br>
> then mv -f ".deps/unitTest.Tpo" ".deps/unitTest.Po"; else rm -f<br>
> ".deps/unitTest.Tpo"; exit 1; fi<br>
> /usr/include/c++/3.3.5/bits/stl_iterator_base_types.h: In instantiation<br>
> of `std::iterator_traits<int>':<br>
> /usr/include/c++/3.3.5/bits/basic_string.h:624: instantiated from<br>
> `std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT,<br>
> _Traits, _Alloc>::replace(__gnu_cxx::__normal_iterator<typename<br>
> _Alloc::pointer, std::basic_string<_CharT, _Traits, _Alloc> >,<br>
> __gnu_cxx::__normal_iterator<typename _Alloc::pointer,<br>
> std::basic_string<_CharT, _Traits, _Alloc> >, _InputIterator,<br>
> _InputIterator) [with _InputIterator = int, _CharT = char, _Traits =<br>
> std::char_traits<char>, _Alloc = std::allocator<char>]'<br>
> /usr/include/c++/3.3.5/bits/basic_string.h:492: instantiated from<br>
> `std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT,<br>
> _Traits, _Alloc>::append(_InputIterator, _InputIterator) [with<br>
> _InputIterator = int, _CharT = char, _Traits = std::char_traits<char>,<br>
> _Alloc = std::allocator<char>]'<br>
> ../../../Clp/src/unitTest.cpp:1978: instantiated from here<br>
> /usr/include/c++/3.3.5/bits/stl_iterator_base_types.h:126: error: `int'<br>
> is not<br>
> a class, struct, or union type<br>
> /usr/include/c++/3.3.5/bits/stl_iterator_base_types.h:127: error: `int'<br>
> is not<br>
> ...etc.<br>
<br>
-- <br>
Michael hennebry@web.cs.ndsu.NoDak.edu<br>
"Pessimist: The glass is half empty.<br>
Optimist: The glass is half full.<br>
Engineer: The glass is twice as big as it needs to be."<br>
<br>
_______________________________________________<br>
Clp mailing list<br>
Clp@list.coin-or.org<br>
</tt><tt><a href="http://list.coin-or.org/mailman/listinfo/clp">http://list.coin-or.org/mailman/listinfo/clp</a></tt><tt><br>
</tt><br>
<br>
</body></html>