error C2668: 'ns3::MakeCallback' : ambiguous call to overloaded function

45 views
Skip to first unread message

Doaa Terri

unread,
Jul 5, 2015, 9:36:17 AM7/5/15
to ns-3-...@googlegroups.com
Hi all,

I am trying to calculate throughput for each node in my network. I used the tracing in order to get the data, but I encountered this error : 
error C2668: 'ns3::MakeCallback' : ambiguous call to overloaded function 

I am not sure what I did wrong in my callback function, can some one help me? 

Attached is my complete code. 

Thanks in advance 
  
code2.txt

Konstantinos

unread,
Jul 5, 2015, 12:07:25 PM7/5/15
to ns-3-...@googlegroups.com, doaa...@gmail.com
Hi Doaa,

I am wondering if this scenario you attached is working, since you do not even have a Simulator::Run()!

For your error, please check the definitions you have for ReceivePacket. You have the SAME function name with two definitions which make it 'ambiguous' to the Callback. 

void ReceivePacket (Ptr<Socket> socket)
{
NS_LOG_UNCOND
("Received one packet!");
std
::cout<<"received one packet"<<std::endl;
}

void
ReceivePacket(string context, Ptr <const Packet> p)
{
 totalBytesReceived
+= p->GetSize();
}


Regards,
K.

Doaa Terri

unread,
Jul 5, 2015, 3:42:17 PM7/5/15
to ns-3-...@googlegroups.com
Hi Konstantinos! 

Yah my scenario is working, it seems that I did not copy the complete code :/, the last part is missing! 

The problem has been solved, I just kept one declaration for ReceivePacket. Thanks a lot :) 


--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/uIUDEf_kJzI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages