Problem with new channel

61 views
Skip to first unread message

Joan

unread,
Mar 16, 2015, 9:37:07 AM3/16/15
to ns-3-...@googlegroups.com
Hello,

I'm developing a new channel modifying parts of the point-to-point module. I'm getting compilation errors from the parts I have actually not changed. In the channel class, in the transmission start function, I am scheduling a receive action in the receiving net device:

Simulator::ScheduleWithContext (m_link[wire].m_dst->GetNode ()->GetId (),txTime + m_delay, &SimpleNetDevice::Receive, m_link[wire].m_dst, p);

As you see, it is the same we have in p2p channel, I have just changed the name of the net device class. This is the compiler error:

simple-channel.cc:109:5: error: no matching function for call to 'ScheduleWithContext'
    ns3::Simulator::ScheduleWithContext (m_link[wire].m_dst->GetNode ()->GetId (), txTime + m_delay, &SimpleNetDevice::Receive, m_link[wire].m_dst, p);
./ns3/simulator.h:914:17: note: candidate template ignored: couldn't infer template argument 'MEM'
void Simulator::ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
                ^
./ns3/simulator.h:956:17: note: candidate template ignored: couldn't infer template argument 'U1'
void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3)


I understand that it is not able to find the method I want to schedule, &SimpleNetDevice::Receive, but I do not get why. I have reviewed if I missed any "include" but everything seems normal. I have not modified many things in the channel, i am focused on the net device part, and the receive function remains as it was in p2p module. The channel is using SimpleNetDevice in other functions but I am not getting any other errors.

Has anyone encountered anything similar when implementing a new channel module??

Thanks

Joan

unread,
Mar 16, 2015, 10:20:12 AM3/16/15
to ns-3-...@googlegroups.com
I found the problem, it was quite stupid. I had two functions called Receive with different number of arguments. The compiler had difficulties differencing them. I renamed them with two different names and it worked.

Sorry, you can marked as closed

Tommaso Pecorella

unread,
Mar 16, 2015, 2:21:05 PM3/16/15
to ns-3-...@googlegroups.com
Glad you found the problem.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages