Opened 16 years ago
Closed 16 years ago
#268 closed defect (fixed)
min_cost_flow_test.cc does not compile with VS2005
Reported by: | Akos Ladanyi | Owned by: | Peter Kovacs |
---|---|---|---|
Priority: | blocker | Milestone: | LEMON 1.1 release |
Component: | core | Version: | hg main |
Keywords: | Cc: | ||
Revision id: | 85cb3aa71cce |
Description
Compiling... min_cost_flow_test.cc Z:\lemon-lp-final\lemon/network_simplex.h(1228) : error C2668: 'sqrt' : ambiguous call to overloaded function C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(581): could be 'long double sqrt(long double)' C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(533): or 'float sqrt(float)' C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(128): or 'double sqrt(double)' while trying to match the argument list '(int)' Z:\lemon-lp-final\lemon/network_simplex.h(1062) : while compiling class template member function 'bool lemon::NetworkSimplex<GR,F,C>::init(void)' with [ GR=GR, F=Flow, C=Cost ] ..\..\test\min_cost_flow_test.cc(274) : see reference to class template instantiation 'lemon::NetworkSimplex<GR,F,C>' being compiled with [ GR=GR, F=Flow, C=Cost ] Z:\lemon-lp-final\lemon/network_simplex.h(1228) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Attachments (3)
Change History (9)
comment:1 follow-up: 2 Changed 16 years ago by
Owner: | changed from Alpar Juttner to Peter Kovacs |
---|---|
Status: | new → assigned |
Changed 16 years ago by
Attachment: | ns-vs-fix-b72846480f05.patch added |
---|
Changed 16 years ago by
Attachment: | 0c8e5c688440.patch added |
---|
comment:2 follow-up: 3 Changed 16 years ago by
Replying to kpeter:
[b72846480f05] contains a fix. Could you please check it?
The changeset [0c8e5c688440] also fixes the other faulty usages of sqrt()
.
comment:3 Changed 16 years ago by
Replying to alpar:
The changeset [0c8e5c688440] also fixes the other faulty usages of
sqrt()
.
It is better then mine. I couldn't test it with VS2005.
comment:4 Changed 16 years ago by
min_cost_flow_test.cc still fails to compile (dimacs-solver.cc too for the same reason):
Compiling... min_cost_flow_test.cc Z:\lemon-lp-final\lemon/elevator.h(117) : error C2664: 'lemon::DigraphExtender<Base>::NodeMap<_Value>::NodeMap(const lemon::DigraphExtender<Base> &)' : cannot convert parameter 1 from 'const lemon::ReverseDigraph<DGR>' to 'const lemon::DigraphExtender<Base> &' with [ Base=lemon::ListDigraphBase, _Value=lemon::ListDigraphBase::Node * ] and [ DGR=const GR ] and [ Base=lemon::ListDigraphBase ] Reason: cannot convert from 'const lemon::ReverseDigraph<DGR>' to 'const lemon::DigraphExtender<Base>' with [ DGR=const GR ] and [ Base=lemon::ListDigraphBase ] No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Z:\lemon-lp-final\lemon/elevator.h(108) : while compiling class template member function 'lemon::Elevator<GR,Item>::Elevator(const GR &,int)' with [ GR=lemon::ReverseDigraph<const GR>, Item=lemon::ListDigraphBase::Node ] Z:\lemon-lp-final\lemon/circulation.h(361) : see reference to class template instantiation 'lemon::Elevator<GR,Item>' being compiled with [ GR=lemon::ReverseDigraph<const GR>, Item=lemon::ListDigraphBase::Node ] Z:\lemon-lp-final\lemon/circulation.h(356) : while compiling class template member function 'void lemon::Circulation<GR,LM,UM,SM>::destroyStructures(void)' with [ GR=RevGraph, LM=lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<int>, UM=lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<int>, SM=NegNodeMap ] Z:\lemon-lp-final\lemon/network_simplex.h(1193) : see reference to class template instantiation 'lemon::Circulation<GR,LM,UM,SM>' being compiled with [ GR=RevGraph, LM=lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<int>, UM=lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<int>, SM=NegNodeMap ] Z:\lemon-lp-final\lemon/network_simplex.h(1065) : while compiling class template member function 'bool lemon::NetworkSimplex<GR,F,C>::init(void)' with [ GR=GR, F=Flow, C=Cost ] ..\..\test\min_cost_flow_test.cc(274) : see reference to class template instantiation 'lemon::NetworkSimplex<GR,F,C>' being compiled with [ GR=GR, F=Flow, C=Cost ] Z:\lemon-lp-final\lemon/elevator.h(117) : error C2664: 'lemon::DigraphExtender<Base>::NodeMap<_Value>::NodeMap(const lemon::DigraphExtender<Base> &,const _Value &)' : cannot convert parameter 1 from 'const lemon::ReverseDigraph<DGR>' to 'const lemon::DigraphExtender<Base> &' with [ Base=lemon::ListDigraphBase, _Value=int ] and [ DGR=const GR ] and [ Base=lemon::ListDigraphBase ] Reason: cannot convert from 'const lemon::ReverseDigraph<DGR>' to 'const lemon::DigraphExtender<Base>' with [ DGR=const GR ] and [ Base=lemon::ListDigraphBase ] No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
comment:5 Changed 16 years ago by
The problem was about ItemSetTraits
, it seems to be a VS bug again: the template parameter (Graph
) of a class conflicted with the public typedef of its ancestor class. For VS the later one prevails. This diagnosis is actually due to Balazs. (Thanks for it.)
The patch [f2d6d3446adf] solves this issue directly, and [4137ef9aacc6] contains unification and fixes for typedefs Graph, Digraph and Parent in order to prevent such problems. For more information see the commit log.
Both of these changesets can be compiled with VS2008 and gcc.
Changed 16 years ago by
Attachment: | fixes-0c8e5c688440-f2d6d3446adf-4137ef9aacc6.bundle added |
---|
comment:6 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
[b72846480f05] contains a fix. Could you please check it?