<div dir="ltr"><div dir="ltr">Hi Justin<div><br></div><div>You are supposed to call <a href="https://www.nsnam.org/docs/release/3.33/doxygen/classns3_1_1_mobility_model.html#ac584b3d5a309709d2f13ed6ada1e7640">SetPosition</a> public function from outside.</div><div>The DoSetPosition virtual function is for subclasses to implement the functionality, and should not be used elsewhere.</div><div>See <a href="https://blog.spatial.com/3d-software-development-kits/public-virtual-methods-bad-idea">Public Virtual Methods: A Bad Idea</a> for why ns-3 designed it this way.</div><div><br></div><div>Yours, Junxiao</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 28, 2021 at 12:39 PM Justin Rodrigues via ndnSIM <<a href="mailto:ndnsim@lists.cs.ucla.edu">ndnsim@lists.cs.ucla.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr"><p style="text-align:center"><font color="red"><strong>External Email</strong><br></font></p>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">Hello Everyone,</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">I hope you are doing well.<br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">Currently I am facing an error like this which I am unsure how to correct since I have not had it before in c++.</span>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
../src/ndnSIM/examples/mobility-tree-walk3.cpp: In function ‘int ns3::main(int, char**)’:
<div>../src/ndnSIM/examples/mobility-tree-walk3.cpp:171:37: error: ‘virtual void ns3::ConstantVelocityMobilityModel::DoSetPosition(const Vector&)’ is private within this context</div>
<div>   myM.DoSetPosition(Vector(10,10,10));</div>
<div>                                     ^</div>
<div>In file included from ./ns3/mobility-module.h:14:0,</div>
<div>                 from ../src/ndnSIM/examples/mobility-tree-walk3.cpp:24:</div>
<div>./ns3/constant-velocity-mobility-model.h:59:16: note: declared private here</div>
<div>   virtual void DoSetPosition (const Vector &position);</div>
<div>                ^~~~~~~~~~~~~</div>
<div><br>
</div>
<div>Waf: Leaving directory `/home/justin/Downloads/ndn_sim_mobility/ndnsim/ns-3/build'</div>
<div>Build failed</div>
<span> -> task in 'mobility-tree-walk3' failed with exit status 1 (run with -v to display more information)</span><br>
</div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
It is not letting me access a function since its declared as private so I havedeclared the function in the c++ document and edited that file to make the function pubilc yet ns-3 still thinks its private.</div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
Sincerely,</div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
<span style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">Justin Rodrigues</span><br>
</div>
</div><br>
</blockquote></div></div>