Linking Issue with error: (undefined reference to `vtable for ***)

247 views
Skip to first unread message

Yaser M

unread,
Dec 27, 2012, 6:27:44 AM12/27/12
to omn...@googlegroups.com
Dear Sir, 

I am facing the problem that after I clean mixim project that contains veins folder an error starts to appear. The error appears at most of the c++ files telling that these classes are not defined. however they are already defined since I didn't change anything in the mixim file yet!

I am running the simulation on OMNET++ 4.2, windows 7, all veins tutorial steps have been followed exactly. the simulation was running before then I cleaned the project because of a new routing protocol I added and then I rebuilt it then the problem started to appear. I re-installed the whole thing and the problem still appearing. I migrated to OMNET++ 4.2.2 and it still the same.

A message on the consoles appears when I try to start the veins simulation as follow:

../../out/gcc-debug/examples/analogueModels/SamplePhyLayer.o: In function `ZN14SamplePhyLayer24getAnalogueModelFromNameESsRSt3mapISs7cMsgParSt4lessISsESaISt4pairIKSsS1_EEE':
c:\Users\100435392\src\My-Own-trials\OmnetProject\mixim\examples\analogueModels/SamplePhyLayer.cc:115: undefined reference to `PhyLayer::getAnalogueModelFromName(std::string, std::map<std::string, cMsgPar, std::less<std::string>, std::allocator<std::pair<std::string const, cMsgPar> > >&)'
../../out/gcc-debug/examples/analogueModels/SamplePhyLayer.o: In function `PhyLayer':
c:\Users\...\src\My-Own-trials\OmnetProject\mixim\examples\analogueModels/../../src/modules/phy/PhyLayer.h:30: undefined reference to `vtable for PhyLayer'
c:\Users\...\src\My-Own-trials\OmnetProject\mixim\examples\analogueModels/../../src/modules/phy/PhyLayer.h:30: undefined reference to `vtable for PhyLayer'
c:\Users\...\src\My-Own-trials\OmnetProject\mixim\examples\analogueModels/../../src/modules/phy/PhyLayer.h:30: undefined reference to `vtable for PhyLayer'
c:\Users\...\src\My-Own-trials\OmnetProject\mixim\examples\analogueModels/../../src/modules/phy/PhyLayer.h:30: undefined reference to `vtable for PhyLayer'
../../out/gcc-debug/examples/analogueModels/SamplePhyLayer.o: In function `~PhyLayer':
c:\Users\...\src\My-Own-trials\OmnetProject\mixim\examples\analogueModels/../../src/modules/phy/PhyLayer.h:30: undefined reference to `vtable for PhyLayer'
../../out/gcc-debug/examples/analogueModels/SamplePhyLayer.o:c:\Users\...\src\My-Own-trials\OmnetProject\mixim\examples\analogueModels/../../src/modules/phy/PhyLayer.h:30: more undefined references to `vtable for PhyLayer' follow
../../out/gcc-debug/examples/analogueModels/SamplePhyLayer.o:SamplePhyLayer.cc:(.rdata$_ZTV14SamplePhyLayer[vtable for SamplePhyLayer]+0x1d4): undefined reference to `PhyLayer::initializeBreakpointPathlossModel(std::map<std::string, cMsgPar, std::less<std::string>, std::allocator<std::pair<std::string const, cMsgPar> > >&)'
../../out/gcc-debug/examples/analogueModels/SamplePhyLayer.o:SamplePhyLayer.cc:(.rdata$_ZTV14SamplePhyLayer[vtable for SamplePhyLayer]+0x1d8): undefined reference to `PhyLayer::initializePERModel(std::map<std::string, cMsgPar, std::less<std::string>, std::allocator<std::pair<std::string const, cMsgPar> > >&)'
../../out/gcc-debug/examples/analogueModels/SamplePhyLayer.o:SamplePhyLayer.cc:(.rdata$_ZTV14SamplePhyLayer[vtable for SamplePhyLayer]+0x1dc): undefined reference to `PhyLayer::initializeDecider80211(std::map<std::string, cMsgPar, std::less<std::string>, std::allocator<std::pair<std::string const, cMsgPar> > >&)'
../../out/gcc-debug/examples/analogueModels/SamplePhyLayer.o:SamplePhyLayer.cc:(.rdata$_ZTV14SamplePhyLayer[vtable for SamplePhyLayer]+0x1e0): undefined reference to `PhyLayer::initializeDecider802154Narrow(std::map<std::string, cMsgPar, std::less<std::string>, std::allocator<std::pair<std::string const, cMsgPar> > >&)'
make[2]: Leaving directory `/c/Users/100435392/src/My-Own-trials/OmnetProject/mixim/examples/analogueModels'
../../out/gcc-debug/examples/analogueModels/SamplePhyLayer.o:SamplePhyLayer.cc:(.rdata$_ZTV14SamplePhyLayer[vtable for SamplePhyLayer]+0x1e4): undefined reference to `PhyLayer::initializeSNRThresholdDecider(std::map<std::string, cMsgPar, std::less<std::string>, std::allocator<std::pair<std::string const, cMsgPar> > >&)'
collect2: ld returned 1 exit status
make[2]: *** [../../out/gcc-debug/examples/analogueModels/analogueModels.exe] Error 1
make[1]: *** [analogueModels_dir] Error 2
make: *** [examples_dir] Error 2
make[1]: Leaving directory `/c/Users/.../src/My-Own-trials/OmnetProject/mixim/examples'

**** Build Finished ****




Your help well be highly appreciated!

Sarah Madi

unread,
Mar 1, 2013, 12:16:27 PM3/1/13
to omn...@googlegroups.com
Did anyone find a solution for this problem?? I appreciate your help ... thank you all 
Reply all
Reply to author
Forward
0 new messages