Ambiguous overload error in Omnet++ 4.0

107 views
Skip to first unread message

Mämmelä Olli

unread,
Jul 7, 2009, 5:06:27 AM7/7/09
to omn...@googlegroups.com

Hello,

I am trying to migrate a simulation model made in omnet++ v. 3.x to v. 4.0. I first ran the migration tools on all ned, cpp and header files. After that I started manually changing all the files and managed to correct all compile errors except for this one:

c:/omnetpp-4.0/include/cenvir.h ambiguous overload for 'operator<<' in '((cEnvir*)this)->cEnvir::out << t'

line 416

Can anyone help me with this error? There must be some issue between the two different versions of omnet since the cenvir.h in 3.3 does not have these functions:

cEnvir &        operator<< (const std::string &t)      
template<typename T>   
cEnvir &        operator<< (const T &t)
cEnvir &        operator<< (std::ostream &(t)(std::ostream &)) 
std::ostream &  getOStream ()  

The simulation model I am trying to migrate is the BitTorrent module:  http://www.mm.aueb.gr/research/bittorrent/index.html



Andras Varga

unread,
Jul 7, 2009, 8:13:01 AM7/7/09
to omn...@googlegroups.com

cenvir.h line 416 reads:

    template<typename T> cEnvir& operator<<(const T& t) {out << t; return *this;}

 

The error seems to be this: the Bittorrent code tries to print a variable (ev << someVar), and that variable has more than one overloaded << operators somehow. I’m sure the compiler output also contains the line number in the BitTorrent code; try tweaking that line by adding type casts, to get rid of the ambiguity.

 

Regards,

Andras

 

 


Reply all
Reply to author
Forward
0 new messages