[ndnSIM] [EXT] Private Class Error even after an Attempt to Fix
shijunxiao at email.arizona.edu
Thu Jul 1 06:37:45 PDT 2021
You are supposed to call SetPosition
function from outside.
The DoSetPosition virtual function is for subclasses to implement the
functionality, and should not be used elsewhere.
See Public Virtual Methods: A Bad Idea
for why ns-3 designed it this way.
On Mon, Jun 28, 2021 at 12:39 PM Justin Rodrigues via ndnSIM <
ndnsim at lists.cs.ucla.edu> wrote:
> *External Email*
> Hello Everyone,
> I hope you are doing well.
> Currently I am facing an error like this which I am unsure how to correct
> since I have not had it before in c++.
> ../src/ndnSIM/examples/mobility-tree-walk3.cpp: In function ‘int
> ns3::main(int, char**)’:
> ../src/ndnSIM/examples/mobility-tree-walk3.cpp:171:37: error: ‘virtual
> void ns3::ConstantVelocityMobilityModel::DoSetPosition(const Vector&)’ is
> private within this context
> In file included from ./ns3/mobility-module.h:14:0,
> from ../src/ndnSIM/examples/mobility-tree-walk3.cpp:24:
> ./ns3/constant-velocity-mobility-model.h:59:16: note: declared private here
> virtual void DoSetPosition (const Vector &position);
> Waf: Leaving directory
> Build failed
> -> task in 'mobility-tree-walk3' failed with exit status 1 (run with -v
> to display more information)
> 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.
> Justin Rodrigues
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ndnSIM