Rootcint: symbol lookup error: undefined symbol

Hello all,
I’m trying to generate dictionaries for some simple classes, and neither using rootcint nor .L Test.hh++ in root seems to work. I have attached some simplified files that generate the error to play around with. The complete error message reads

rootcint: symbol lookup error: rootcint: undefined symbol: _ZN14G__ShadowMaker15NeedShadowClassER12G__ClassInfo

I’m using ROOT 5.11/01, by the way. Any ideas or comments would be very welcome!
Cheers,
Daniel
Types.hh.gz (106 Bytes)
Test.hh.gz (226 Bytes)
Test.cc.gz (162 Bytes)

I do not see a problem with your files. Both rootcint and .L Test.cc+ works.

It is likely that you did not set LD_LIBRARY_PATH correctly.
LD_LIBRARY_PATH must include $ROOTSYS/lib

Rene

Hello Rene,
thank you for your FAST reply! Impressive…
I checked the LD_LIBRARY_PATH, and indeed there was a problem. It was partially pointing to an old ROOT version. I have fixed this and have now $ROOTSYS/lib, $ROOTSYS/lib/root, $ROOTSYS/include and $ROOTSYS/include/root in it. However, there still seems to be something wrong with my setup. .L Test.hh++ gives me some new error message:

dlopen error: /users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./Test_hh.so: undefined symbol: _ZTI4Test
Load Error: Failed to load Dynamic link library /users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./Test_hh.so
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/…/…/…/crt1.o(.text+0x18): In function _start': ../sysdeps/i386/elf/start.S:115: undefined reference tomain’
/users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./fileiwlLsN.o(.text+0xb8): In function ROOT::GenerateInitInstance(Test const*)': : undefined reference totypeinfo for Test’
/users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./fileiwlLsN.o(.text+0x3da): In function ROOT::new_Test(void*)': : undefined reference toTest::Testin-charge
/users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./fileiwlLsN.o(.text+0x40b): In function ROOT::new_Test(void*)': : undefined reference toTest::Testin-charge
/users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./fileiwlLsN.o(.text+0x514): In function ROOT::newArray_Test(long, void*)': : undefined reference toTest::Testin-charge
/users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./fileiwlLsN.o(.text+0x5f4): In function ROOT::newArray_Test(long, void*)': : undefined reference toTest::Testin-charge
/users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./fileiwlLsN.o(.text+0x8a2): In function G__fileiwlLsN_1192_1_0(G__value*, char const*, G__param*, int)': : undefined reference toTest::Testin-charge
/users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./fileiwlLsN.o(.text+0x9aa): more undefined referencesto Test::Test[in-charge]()' follow /users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./fileiwlLsN.o(.text+0xc0d): In functionG__fileiwlLsN_1192_3_0(G__value*, char const*, G__param*, int)’:
: undefined reference to Test::SetRecoX(double*)' /users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./fileiwlLsN.o(.gnu.linkonce.t._ZN4TestC1ERKS_+0x29): In functionTest::Test[in-charge](Test const&)’:
: undefined reference to `vtable for Test’
collect2: ld returned 1 exit status
*** Interpreter error recovered ***

, while simple compilation with rootcint -f test2.cc -c -I$ROOTSYS/include Test.hh seems to work.
I did set .include $ROOTSYS/include before. Anyway, once I try to load the .so generated by rootcint with .L Test_hh.so, I again get the error message

dlopen error: /users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./Test_hh.so: undefined symbol: _ZTI4Test
Load Error: Failed to load Dynamic link library /users/scr0_pc62/astro/greiner/tools/DoubleChooz/cvs/collaborators/anatael/DOGS/DCEvent/./Test_hh.so

I’m forgetting something here, am I not?
Cheers,
Daniel

You are adding to LD_LIBRARY_PATH things not related with the path.
Could you set
LD_LIBRARY_PATH=$ROOTSYS/lib
PATH=$ROOTSYS/bin:$PATH
and try
root > .L test.cc+

If you still have problems send me the output of
echo $PATH
echo $LD_LIBRARY_PATH
ls -l $ROOTSYS/bin
ls -l $ROOTSYS/lib

Could you also indicate how you install ROOT/ from source? from binaries.
It is clear that you have something wrong in your installation.

Rene

Hello again, Rene,
it works now! Thank you! There were indeed problems with my PATH variable: It seems a previous version of rootcint was found in another directory in the PATH, and this produced some confusion. I simply had to change the order of the entries in the PATH variable to fix that.
The only thing I had to do additionally was to include the $ROOTSYS/lib/root subdirectory, else libCore.so couldn’t be found when starting root.
Cheers,
Daniel