[ndnSIM] Linking error

Alex Afanasyev aa at cs.fiu.edu
Mon Jan 8 05:22:01 PST 2018


You cannot just rename the scenario, as there is a naming convention of how scenarios are compiled.  Normally, the scenario.cpp file is linked together with ndnSIM and rest of NS-3 and nothing else.  In this case, the scenario is also linked to all compilation units under <scenario>/ folder.  Therefore, if you rename just scenario.cpp, it is no longer linked to other required files and you have errors.

My default recommendation is to use the scenario template that applies a more user-friendly conventions described in README.

--
Alex

> On Jan 3, 2018, at 11:26 AM, chavoosh ghasemi <chavoosh.ghasemi.off at gmail.com <mailto:chavoosh.ghasemi.off at gmail.com>> wrote:
> 
> Yes, it is included ("ndn-load-balancer/random-load-balancer-strategy.hpp"). To clarify the problem, even if I just copy and paste ndn-load-balancer.cpp example and rename it, it won't work. Something is wrong with linking part and I guess maybe I need to add the name of new examples to waf/makefile. If you can, please test it on your own machine and let me know if you had any problem.
> 
> On Wed, Jan 3, 2018 at 8:17 AM, Spyridon (Spyros) Mastorakis <mastorakis at cs.ucla.edu <mailto:mastorakis at cs.ucla.edu>> wrote:
> Hi,
> 
> have you included the appropriate header file in your example?
> 
> Thanks,
> 
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
> Internet Research Laboratory
> Computer Science Department
> UCLA
> 
>> On Jan 2, 2018, at 11:46 PM, chavoosh ghasemi <chavoosh.ghasemi.off at gmail.com <mailto:chavoosh.ghasemi.off at gmail.com>> wrote:
>> 
>> Hi,
>> 
>> I'm trying to use RandomLoadBalancer strategy in an example; however, apparently, there is a linking error. The example is located in the "examples" directory. Do I need to add the name of this example to any make/waf file?
>> 
>> BTW, in continue, you can find the error after trying to run ./waf command.
>> 
>> 
>> [3165/3179] Linking build/src/ndnSIM/examples/ns3-dev-icdn-simple-debug
>> 
>> src/ndnSIM/examples/icdn-simple.cpp.1.o: In function `void ns3::ndn::StrategyChoiceHelper::Install<nfd::fw::RandomLoadBalancerStrategy>(ns3::Ptr<ns3::Node>, ndn::Name const&)':
>> /home/vagrant/ndnSIM/ns-3/build/./ns3/ndnSIM/helper/ndn-strategy-choice-helper.hpp:119: undefined reference to `nfd::fw::RandomLoadBalancerStrategy::getStrategyName()'
>> /home/vagrant/ndnSIM/ns-3/build/./ns3/ndnSIM/helper/ndn-strategy-choice-helper.hpp:120: undefined reference to `nfd::fw::RandomLoadBalancerStrategy::getStrategyName()'
>> /home/vagrant/ndnSIM/ns-3/build/./ns3/ndnSIM/helper/ndn-strategy-choice-helper.hpp:123: undefined reference to `nfd::fw::RandomLoadBalancerStrategy::getStrategyName()'
>> src/ndnSIM/examples/icdn-simple.cpp.1.o: In function `std::unique_ptr<nfd::fw::RandomLoadBalancerStrategy, std::default_delete<nfd::fw::RandomLoadBalancerStrategy> > ndn::make_unique<nfd::fw::RandomLoadBalancerStrategy, nfd::Forwarder&, ndn::Name const&>(nfd::Forwarder&, ndn::Name const&)':
>> /home/vagrant/ndnSIM/ns-3/build/ns3/ndnSIM/ndn-cxx/util/backports.hpp:75: undefined reference to `nfd::fw::RandomLoadBalancerStrategy::RandomLoadBalancerStrategy(nfd::Forwarder&, ndn::Name const&)'
>> collect2: error: ld returned 1 exit status
>> 
>> Thanks,
>> - Chavoosh
>> --
>> Chavoosh Ghasemi
> 
> 
> 
> 
> --
> Chavoosh Ghasemi
> 
> Ph.D. Student in Computer Networking
> University of Arizona - Computer Science Department
> Address: Gould-Simpson 721B, 1040 E. 4th Street,
>                  Tucson, AZ 85721
> 
> "The quieter you become, the more you can hear"
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu <mailto:ndnSIM at lists.cs.ucla.edu>
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim <http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim>
______________
Alex Afanasyev
Assistant Professor, SCIS, Florida International University
11200 SW 8th Street, ECS Room 261B, Miami, FL 33199
phone: +1.305.348.4960 (office); email: aa at cs.fiu.edu <mailto:aa at cs.fiu.edu>
web: https://users.cs.fiu.edu/~afanasyev/ <https://users.cs.fiu.edu/~afanasyev/>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180108/ac872cb2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 873 bytes
Desc: Message signed with OpenPGP
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180108/ac872cb2/attachment-0001.sig>


More information about the ndnSIM mailing list