[Nfd-dev] HOWTO solve "undefined symbol" error

Junxiao Shi shijunxiao at email.arizona.edu
Tue Aug 23 18:25:23 PDT 2016


Dear folks

One problem you might encounter after compiling a project dependent on
ndn-cxx is: there's "undefined symbol" error at runtime.
An example looks like:
$ build/unit-tests
Running 53 test cases...
unit-tests: symbol lookup error: unit-tests: undefined symbol:
_ZN3ndn4NameC1ERKSs

There are two common causes for an undefined symbol that appears to be from
ndn-cxx (it contains "ndn"):

   - You have upgraded or downgraded ndn-cxx, but did not completely
   recompile the dependent project (such as NFD, ndn-tools, NLSR).
   - You compiled the program with one version of ndn-cxx, but the
   installed library is of a different version.

Solution to the first cause is: execute ./waf distclean in the dependent
project repository, and start over since ./waf configure step.

The second cause is most commonly seen during execution of a program in
ndn-cxx repository (such as ndn-cxx unit tests or ndnsec), when ndn-cxx is
compiled as dynamic library.
This is more likely to occur on OSX machines.
The solution is to execute sudo ./waf install (omit sudo if you are using
HomeBrew), and then run the program again.


If the undefined symbol appears to be from boost (it contains "boost"), a
possible cause is that you have upgraded Boost libraries.
This is more likely to occur on OSX machines, where HomeBrew can upgrade
Boost between releases.
The solution is to execute ./waf distclean in ndn-cxx repository,
re-compile and re-install ndn-cxx, and finally follow the solution in the
first cause of ndn-cxx symbol.


This article is part of "HOWTOs for n00b" series. You may find other
articles in this series on NFD wiki
<http://redmine.named-data.net/projects/nfd/wiki> under developer resources.

Yours, Junxiao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20160823/ab75520a/attachment.html>


More information about the Nfd-dev mailing list