Discussion:
vtable undefined reference
Manoj Kumar Jha
2014-10-18 01:32:17 UTC
Permalink
Hello,
I am getting error like "vtable undefined reference". I defined all
the constructor, destructor and virtual functions. I am using root
version 5.34/18. The files are in my public area on lxplus. Please see
below on how to reproduce it.

"""
[***@lxbrb2710 StandAlone2014]$ pwd
/afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014
[***@lxbrb2710 StandAlone2014]$ which root
/cvmfs/cms.cern.ch/slc6_amd64_gcc481/cms/cmssw/CMSSW_7_1_8/external/slc6_amd64_gcc481/bin/root
[***@lxbrb2710 StandAlone2014]$ ./run.sh

...

...
Info in <TUnixSystem::ACLiC>: creating shared library
/afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014/./AnalysisTemplate_C.so
dlopen error:
/afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014/./AnalysisTemplate_C.so:
undefined symbol: _ZTVN6purdue3JetE
Load Error: Failed to load Dynamic link library
/afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014/./AnalysisTemplate_C.so
/usr/lib/../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014/AnalysisTemplate_C_ACLiC_dict.o:
In function `purdue::Muon::Muon()':


"""

Thanks for your help.

-Manoj
--
------------------------------------------------------------------
Manoj Kumar Jha Department of Physics
***@purdue.edu Purdue University
(765) 494-5987 W. Lafayette, IN 47907-2036, USA
-------------------------------------------------------------------
Greg Jung
2014-10-18 05:11:35 UTC
Permalink
I just went through the same issue today. I added a class to my build, and
somewhere
along the line it wasn't picked up for the linker. Use
$ nm -C <objectfile> | grep (class name)
to check out the status. In my case, I had added a class with exactly the
same
routtines as one before, and tried to rebuild the project from the middle;
some step
in the production of Makefile wasn't done right for the new collection.

here's some more chat about this:
http://stackoverflow.com/questions/3065154/undefined-reference-to-vtable
Post by Manoj Kumar Jha
Hello,
I am getting error like "vtable undefined reference". I defined all
the constructor, destructor and virtual functions. I am using root
version 5.34/18. The files are in my public area on lxplus. Please see
below on how to reproduce it.
"""
/afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014
/cvmfs/cms.cern.ch/slc6_amd64_gcc481/cms/cmssw/CMSSW_7_1_8/
external/slc6_amd64_gcc481/bin/root
...
...
Info in <TUnixSystem::ACLiC>: creating shared library /afs/
cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014/./AnalysisTemplate_C.so
dlopen error: /afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014/./
AnalysisTemplate_C.so: undefined symbol: _ZTVN6purdue3JetE
Load Error: Failed to load Dynamic link library /afs/cern.ch/user/j/jha/
public/CMS/Proof/StandAlone2014/./AnalysisTemplate_C.so
(.text+0x20): undefined reference to `main'
/afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014/
"""
Thanks for your help.
-Manoj
--
------------------------------------------------------------------
Manoj Kumar Jha Department of Physics
(765) 494-5987 W. Lafayette, IN 47907-2036, USA
-------------------------------------------------------------------
Manoj Kumar Jha
2014-10-19 13:50:13 UTC
Permalink
Hi Greg,
Thanks for information. When I switched to Makefile, I am able to compile into sharde lib.

Regards,
Manoj
I just went through the same issue today. I added a class to my build, and somewhere
along the line it wasn't picked up for the linker. Use
$ nm -C <objectfile> | grep (class name)
to check out the status. In my case, I had added a class with exactly the same
routtines as one before, and tried to rebuild the project from the middle; some step
in the production of Makefile wasn't done right for the new collection.
http://stackoverflow.com/questions/3065154/undefined-reference-to-vtable
Hello,
I am getting error like "vtable undefined reference". I defined all the constructor, destructor and virtual functions. I am using root version 5.34/18. The files are in my public area on lxplus. Please see below on how to reproduce it.
"""
/afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014
/cvmfs/cms.cern.ch/slc6_amd64_gcc481/cms/cmssw/CMSSW_7_1_8/external/slc6_amd64_gcc481/bin/root
...
...
Info in <TUnixSystem::ACLiC>: creating shared library /afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014/./AnalysisTemplate_C.so
dlopen error: /afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014/./AnalysisTemplate_C.so: undefined symbol: _ZTVN6purdue3JetE
Load Error: Failed to load Dynamic link library /afs/cern.ch/user/j/jha/public/CMS/Proof/StandAlone2014/./AnalysisTemplate_C.so
(.text+0x20): undefined reference to `main'
"""
Thanks for your help.
-Manoj
--
------------------------------------------------------------------
Manoj Kumar Jha Department of Physics
(765) 494-5987 W. Lafayette, IN 47907-2036, USA
-------------------------------------------------------------------
Loading...