[Coin-discuss] Problem compiling OsiCuts under MS VC++ 2005 (Compiler Level 14.00.50.727.42)

Stefano Gliozzi stefano_gliozzi at it.ibm.com
Tue Apr 4 09:50:36 EDT 2006


Hi all, 
I'm having some problems in compiling any optimization code which includes 
   osicuts.hpp . 

The MS VC++ 2005 compiler, complains on the following definition: 

const OsiCut * OsiCuts::mostEffectiveCutPtr() const 
{ 
  const_iterator b=begin();
  const_iterator e=end();
  return *(std::min_element(b,e,OsiCutCompare()));
}

and the issue ssems to be that b and e are not of iterator class, as 
expected, but  are const_iterator and the compiler does not know how to 
treat them 

These are the first few error lines issued by the compiler

mpp_CoinSetupIp.cpp
d:\program files\microsoft visual studio 8\vc\include\xutility(572) : 
error C2039: 'iterator_category' : is not a member of 
'OsiCuts::const_iterator'
        e:\coin\include\osicuts.hpp(77) : see declaration of 
'OsiCuts::const_iterator'
        d:\program files\microsoft visual studio 
8\vc\include\xutility(1368) : see reference to class template 
instantiation 'std::iterator_traits<_Iter>' being compiled
        with
        [
            _Iter=OsiCuts::const_iterator
        ]
        d:\program files\microsoft visual studio 
8\vc\include\algorithm(3819) : see reference to function template 
instantiation 'void std::_Debug_range<_FwdIt>(_InIt,_InIt,const wchar_t 
*,unsigned int)' being compiled
        with
        [
            _FwdIt=OsiCuts::const_iterator,
            _InIt=OsiCuts::const_iterator
        ]
        d:\program files\microsoft visual studio 
8\vc\include\algorithm(3833) : see reference to function template 
instantiation '_FwdIt std::_Min_element<_FwdIt,_Pr>(_FwdIt,_FwdIt,_Pr)' 
being compiled
        with
        [
            _FwdIt=OsiCuts::const_iterator,
            _Pr=OsiCuts::OsiCutCompare
        ]
        e:\coin\include\osicuts.hpp(367) : see reference to function 
template instantiation '_FwdIt 
std::min_element<OsiCuts::const_iterator,OsiCuts::OsiCutCompare>(_FwdIt,_FwdIt,_Pr)' 
being compiled
        with
        [
            _FwdIt=OsiCuts::const_iterator,
            _Pr=OsiCuts::OsiCutCompare
        ]

If I comment out completely this method, all the OSI libraries compile 
fine. 

Anyone had the same problem ? 

Best regards, 
Stefano Gliozzi

Managing Consultant 
IBM Business Consulting Services
Ph. +39-06-596-65477,   Mobile +39-335-7389709
Fax. +39-06-596-65477
e-mail: stefano_gliozzi @ it.ibm.com
mail: Via Sciangai, 53 - 00144 Roma - ITALY
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20060404/326aa525/attachment.html>


More information about the Coin-discuss mailing list