<div dir="ltr"><div>Dear folks</div><div><br></div><div>One problem you might encounter after compiling a project dependent on ndn-cxx is: there's "undefined symbol" error at runtime.</div><div>An example looks like:</div><div><div><font face="monospace, monospace">$ build/unit-tests</font></div><div><font face="monospace, monospace">Running 53 test cases...</font></div><div><font face="monospace, monospace">unit-tests: symbol lookup error: unit-tests: undefined symbol: _ZN3ndn4NameC1ERKSs</font></div><div><br></div></div><div>There are two common causes for an undefined symbol that appears to be from ndn-cxx (it contains "ndn"):</div><div><ul><li>You have upgraded or downgraded ndn-cxx, but did not completely recompile the dependent project (such as NFD, ndn-tools, NLSR).</li><li>You compiled the program with one version of ndn-cxx, but the installed library is of a different version.</li></ul></div><div>Solution to the first cause is: execute <font face="monospace, monospace">./waf distclean</font> in the dependent project repository, and start over since <font face="monospace, monospace">./waf configure</font> step.</div><div><br></div><div>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.</div><div>This is more likely to occur on OSX machines.</div><div>The solution is to execute <font face="monospace, monospace">sudo ./waf install</font> (omit sudo if you are using HomeBrew), and then run the program again.</div><div><br></div><div><br></div><div>If the undefined symbol appears to be from boost (it contains "boost"), a possible cause is that you have upgraded Boost libraries.</div><div>This is more likely to occur on OSX machines, where HomeBrew can upgrade Boost between releases.<br></div><div>The solution is to execute <font face="monospace, monospace">./waf distclean</font> in ndn-cxx repository, re-compile and re-install ndn-cxx, and finally follow the solution in the first cause of ndn-cxx symbol.</div><div><br></div><div><br></div><div><div class="gmail_extra"><div class="gmail_extra">This article is part of "HOWTOs for n00b" series. You may find other articles in this series on <a href="http://redmine.named-data.net/projects/nfd/wiki">NFD wiki</a> under developer resources.</div><div><br></div><div>Yours, Junxiao</div></div></div></div>