debug/libns3.so Undefined reference

Skip to first unread message

Hanene GABTENI

unread,
Aug 30, 2012, 6:15:00 AM8/30/12
to ns-3-...@googlegroups.com
Hi all,

I'm implementing new module in NS-3 I 'm inspired from AODV to set up the basic functionalities (it inherits from Ipv4RoutingProtocol)...
But I encoutered this ERROR:

debug/libns3.so: undefined reference to `vtable for ns3::RoutingProtocol'
debug/libns3.so: undefined reference to `typeinfo for ns3::RoutingProtocol'
collect2: ld returned 1 exit status

What aspect could I correct please.

Thanks and best regards,



--
Hanene GABTENI
University of Haute Alsace
IUT - 34 rue du Grillenbreit 68008 Colmar - France
Email : gabteni.h...@gmail.com or hanene.gabteni@uha.fr
web : http://grtc.uha.fr/MembresGRTC.html
tel: 07 86 33 93 39

Larissa Marinho Eglem de Oliveira

unread,
Aug 30, 2012, 9:05:41 AM8/30/12
to ns-3-...@googlegroups.com
Hi, I'm having the same problem. I'm trying to implement a new module, it used to work fine in ns-3.8, but I'm having issues trying to update the code.

Did you see : http://shieldroute.blogspot.se/2012/08/extending-ns3-with-your-module-and.html ? It suggests o solution, but he is using external libraries in his module.

This is my error:

./libns3-internet.so: undefined reference to `ns3::DispatchModule::Enqueue(ns3::Ptr<ns3::Packet>, ns3::Ipv4Header)'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::DoGetMacAddr()'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::DoGetCognitiveInterface()'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::GetFlagAck()'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::Send()'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::GetMainAddress()'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::SetCognitiveInterface(ns3::Ptr<ns3::Ipv4Interface>)'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::CognitiveSend()'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::DoPopQueue()'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::SetMainInterface(ns3::Ptr<ns3::Ipv4Interface>)'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::DoGetCognitiveIp()'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::~DispatchModule()'
./libns3-internet.so: undefined reference to `ns3::DispatchModule::DispatchModule()'
collect2: ld returned 1 exit status
Waf: Leaving directory `/home/larissa/workspace/ns-3-allinone/ns-3.13/build'
Build failed
 -> task failed (exit status 1): 
{task 172407564: cxxprogram test-ipv6.cc.5.o -> test-ipv6}
['/usr/bin/g++', 'examples/ipv6/test-ipv6.cc.5.o', '-o', '/home/larissa/workspace/ns-3-allinone/ns-3.13/build/examples/ipv6/test-ipv6', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--no-as-needed', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-lns3-point-to-point', '-lns3-internet', '-lns3-mpi', '-lns3-bridge', '-lns3-network', '-lns3-core', '-lrt', '-lgsl', '-lgslcblas', '-lm', '-pthread']



2012/8/30 Hanene GABTENI <gabteni.h...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

Mitch Watrous

unread,
Aug 30, 2012, 6:58:01 PM8/30/12
to ns-3-...@googlegroups.com
Be sure to implement all virtual functions defined in the base class.

Make sure the base class destructor is virtual

Implement the destructor in your new class.

Mitch

Hanene GABTENI

unread,
Aug 31, 2012, 5:14:45 AM8/31/12
to ns-3-...@googlegroups.com
Thanks a lot Mich!
I have implémented the destructor and this works OK now!

Best Regards!


2012/8/31 Mitch Watrous <wat...@u.washington.edu>

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/wrQxBRP8cC4J.

To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

Mohamed Hail

unread,
Nov 26, 2014, 9:06:43 AM11/26/14
to ns-3-...@googlegroups.com

Hi,
I am trying to compile the ndnSIM after define a pointer of one class from the energy model offered in ns3.
To clear it, e.g. If I define the pointer of "SimpleDeviceEnergyModel" anywhere in ndnSIM, see following code!
//----------------------------------------------------------
#include "ns3/simple-device-energy-model.h"
Class AnyClassInNdnSIM {    public:         Ptr<SimpleDeviceEnergyModel> sdem;
};
//---------------------------------------------------------- I am getting the following message: ./libns3-dev-ndnSIM-debug.so: undefined reference to `ns3::SimpleDeviceEnergyModel::SimpleDeviceEnergyModel()' ./libns3-dev-ndnSIM-debug.so: undefined reference to `ns3::SimpleDeviceEnergyModel::GetTypeId()' collect2: ld returned 1 exit statusWaf: Leaving directory `/home/alhail/workspace/ndnSIM/ns-3/build' Build failed........... Could you give me any advise to solve this problem? Regards
Mohamed

Mohamed Hail

unread,
Nov 26, 2014, 9:08:29 AM11/26/14
to ns-3-...@googlegroups.com

Hi,
I am trying to compile the ndnSIM after define a pointer of one class from the energy model offered in ns3.
To clear it, e.g. If I define the pointer of "SimpleDeviceEnergyModel" anywhere in ndnSIM, see following code!
//----------------------------------------------------------
#include "ns3/simple-device-energy-model.h"
Class AnyClassInNdnSIM {    public:         Ptr<SimpleDeviceEnergyModel> sdem;
};
//---------------------------------------------------------- I am getting the following message: ./libns3-dev-ndnSIM-debug.so: undefined reference to `ns3::SimpleDeviceEnergyModel::SimpleDeviceEnergyModel()' ./libns3-dev-ndnSIM-debug.so: undefined reference to `ns3::SimpleDeviceEnergyModel::GetTypeId()' collect2: ld returned 1 exit statusWaf: Leaving directory `/home/alhail/workspace/ndnSIM/ns-3/build' Build failed........... Could you give me any advise to solve this problem? Regards
Mohamed



Reply all
Reply to author
Forward
0 new messages