error: cannot convert ‘ns3::Node*’ to ‘ns3::NetDevice*’ in initialization

393 views
Skip to first unread message

Kamran Zahoor

unread,
Nov 5, 2018, 2:48:18 AM11/5/18
to ns-3-users
Hey all! tried to find for any similar thread addressing such problem but there was none. I'm trying to run a very simple simulation to stream the video from remote host to two UEs in LTE scenario. Attached in my code. I'm using the evalvid module. But, I'm encountering below mentioned problem while building the code. I'm unable to understand what this problem is. Please if anyone could help, it would be really a big favor.

In file included from ./ns3/attribute.h:25:0,
                 from ./ns3/csma-helper.h:25,
                 from ../scratch/Phase2.cc:24:
./ns3/ptr.h: In instantiation of ‘ns3::Ptr<T>::Ptr(const ns3::Ptr<U>&) [with U = ns3::Node; T = ns3::NetDevice]’:
../scratch/Phase2.cc:142:60:   required from here
./ns3/ptr.h:748:27: error: cannot convert ‘ns3::Node*’ to ‘ns3::NetDevice*’ in initialization
   : m_ptr (PeekPointer (o))

Many thanks in advance.

Humble Regards:
Kamran Zahoor Khan
Phase2.cc

Biljana Bojović

unread,
Nov 6, 2018, 7:04:53 AM11/6/18
to ns-3-users
Hi Kamran,

please take a look into the ns-3 Doxygen documentation where you can see all classes, functions, their parameters, etc... what is the type of the parameter of the funcion you are calling in your simulation program. In this case you are passing to the function NodeContainer y Node when the funcion expects NetDeviceContainer and NetDevice. Thus, instead of passing ueNodes and enbNodes.Get(0) you should pass ueLteDevs and enbLteDevs.Get(0) (names according your simulation program).

Best regards,
Biljana

Kamran Zahoor

unread,
Nov 6, 2018, 12:24:33 PM11/6/18
to ns-3-...@googlegroups.com
Thanks a bunch man. Error is removed and i've moved a bit forward. Once again thanks a lot. 

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, 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 https://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