Mehic.info

NS3 – undefined reference to..

I received following bug when I tried to install new module and build NS3 :

./libns3.22-network-debug.so: undefined reference to `ns3::Queue::IsFull() const'
collect2: error: ld returned 1 exit status

The problem was that my point-to-point-net-device.cc was calling function

return !(m_queue->IsFull ());

which was not implemented in src/networking/utils/queue.cc. The function was declared in queue.h as virtual but never implemented in queue.cc.

If you have problems with linking it is very useful to run

./waf --no-task-lines -v

In that case after each build step waf will output runner were the compiler and all passed flags are visible. From there you can continue bug hunt 🙂

Thanks to http://shieldroute.blogspot.se/2012/08/extending-ns3-with-your-module-and.html