Home | News | Documentation | Download

Linking Erro with libGui.so


#1

Hello Rooters,
My application is trying to link with libGui.so and is giving error at run time
which states

**___undefined symbol: _ZN5TROOT14RegisterModule**


i had check libGui.so with nm --demangle and found 

 **nm --demangle libGui.so | grep Register**

  **U** TROOT::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int> > > const&, char const**, bool)

I believe this means that the function is not defined.

So do i have to switch on some specific flag while compiling ROOT.

Thanks


#2

Hi,

Are you linking with libGui.so only? it’s not enough TROOT::RegisterModule ins in libCore.so, so you need to link also with libCore.so. I would suggest to use root-config --glibs instead of manually listing the libs

Cheers, Bertrand.


#3

Yes my executable is linked with libCore.so also , infact many others as follows

ldd test.exe

linux-vdso.so.1 (0x00007fff75bd8000)
libgsl.so.0 => /usr/lib/x86_64-linux-gnu/libgsl.so.0 (0x00007f64622bb000)
libGeom.so.6.14 => lib/libGeom.so.6.14 (0x00007f6461e97000)
libgslcblas.so.0 => /usr/lib/x86_64-linux-gnu/libgslcblas.so.0 (0x00007f6461c58000)
libGui.so.6.14 => lib/libGui.so.6.14 (0x00007f64615d4000)
libCore.so.6.14 => lib2/libCore.so.6.14 (0x00007f6460f0c000)
libImt.so.6.14 => lib/libImt.so.6.14 (0x00007f6460cff000)
libRIO.so.6.14 => lib/libRIO.so.6.14 (0x00007f6460754000)
libNet.so.6.14 => lib/libNet.so.6.14 (0x00007f646048b000)
libHist.so.6.14 => lib/libHist.so.6.14 (0x00007f645fec0000)
libGraf.so.6.14 => lib/libGraf.so.6.14 (0x00007f645fb58000)
libGraf3d.so.6.14 => lib/libGraf3d.so.6.14 (0x00007f645f8a8000)
libGpad.so.6.14 => lib/libGpad.so.6.14 (0x00007f645f5d4000)
libROOTDataFrame.so.6.14 => lib/libROOTDataFrame.so.6.14 (0x00007f645f35d000)
libROOTVecOps.so.6.14 => lib/libROOTVecOps.so.6.14 (0x00007f645f089000)
libTree.so.6.14 => lib/libTree.so.6.14 (0x00007f645ed19000)
libTreePlayer.so.6.14 => lib/libTreePlayer.so.6.14 (0x00007f645e9ac000)
libRint.so.6.14 => lib/libRint.so.6.14 (0x00007f645e782000)
libPostscript.so.6.14 => lib/libPostscript.so.6.14 (0x00007f645e50c000)
libMatrix.so.6.14 => lib/libMatrix.so.6.14 (0x00007f645e18d000)
libPhysics.so.6.14 => lib/libPhysics.so.6.14 (0x00007f645df3f000)
libMathCore.so.6.14 => lib/libMathCore.so.6.14 (0x00007f645db31000)
libThread.so.6.14 => lib/libThread.so.6.14 (0x00007f645d8db000)
libMultiProc.so.6.14 => lib/libMultiProc.so.6.14 (0x00007f645d6ca000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f645d32c000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f645d128000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f645cd9f000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f645cb87000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f645c968000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f645c577000)
/lib64/ld-linux-x86-64.so.2 (0x00007f646271d000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f645c35a000)
libtbb.so.2 => /usr/lib/x86_64-linux-gnu/libtbb.so.2 (0x00007f645c11e000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f645be6a000)
libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f645bc38000)

#4

Then TROOT::RegisterModule should be resolved. It should be in libCore.so. Can you check?


#5

Yes i checked using nm it is define in libCore.so, but i don’t know why its not linking.
Is there any way to direct link my executable with libCore.so


#6

-L$(ROOTSYS)/lib -lCore