[ndnSIM] Solution to: "unresolved symbols" related to modified ns-3/src/ndnSIM files

Junxiao Shi shijunxiao at email.arizona.edu
Sun Feb 18 03:13:25 PST 2018

Hi John

I, for example, modified some files in ns-3/src/ndnSIM/NFD/daemon/fw that I
> had created, primarily adding a new member function (method) to a class in
> that folder.
> 1.)  Configure and build ns-3
> 2.)  Then, in your scenario directory:
> ./waf configure
> ./waf --run scenario
> This is insufficient in general. You also need `./waf distclean` before
`./waf configure` in scenario.
It is not strictly necessary when you are just adding a function or
changing a function body in a .cpp of ns-3. It matters when you are
modifying an existing function in a .hpp of ns-3, e.g. changing a default
argument value, changing the body of an inline function.
The reason is: Waf meta build system only tracks changes of the current
project (i.e. scenario), but does not track changes of a system library
(ns-3). Inline functions are compiled into .o objects in scenario/build.
Even if they are changed in ns-3, Waf would not detect the changes and
rebuild .o objects. That would eventually lead to linker errors.

The above paragraph equally applies to building NFD, ndn-tools, etc after
changing ndn-cxx, when not in ndnSIM context.

These commands were of course, copied from the README file.  But I had
> assumed I just needed "./waf configure" instead of "./waf configure -d
> optimized" in the ns-3 folder, and that assumption cost me quite a bit of
> time.
`./waf configure` causes ns-3 to build in debug mode that installs a
separate set of .so libraries, alongside with the optimized .so libraries
built from old ns-3 code. Scenario could continue to pick up the optimized
If you need to debug (gdb, etc) ns-3 through the scenario (although it’s
better to debug ns-3 by putting unit tests into ns-3 itself), you can
install debug libraries but you have to delete the optimized libraries
(look for them in /usr/local/lib).

Yours, Junxiao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180218/1eb3b0d2/attachment.html>

More information about the ndnSIM mailing list