Undefined reference to TRandom

ROOT Version: 6.16/00
Platform: Ubuntu 18.04

I am trying to install geminiROOT and getting the following error while running “make install” command.
g++ -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE=“Gemini” -DVERSION=“4.0.0” -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -I. -I/home/hardev/root/root/include -I/home/hardev/include -g -O2 -MT testDecay.o -MD -MP -MF .deps/testDecay.Tpo -c -o testDecay.o testDecay.cpp
mv -f .deps/testDecay.Tpo .deps/testDecay.Po
/bin/bash ./libtool --tag=CXX --mode=link g++ -g -O2 -L/home/hardev/root/root/lib -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -pthread -lm -ldl -rdynamic -R /home/hardev/root/root/lib -L/home/hardev/root/root/lib libGemini.la -o testDecay testDecay.o

*** Warning: Linking the executable testDecay against the loadable module
*** libGemini.so is not portable!
libtool: link: g++ -g -O2 -pthread -rdynamic -o .libs/testDecay testDecay.o -L/home/hardev/root/root/lib -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -lm -ldl ./.libs/libGemini.so -pthread -Wl,-rpath -Wl,/home/hardev/lib -Wl,-rpath -Wl,/home/hardev/root/root/lib
./.libs/libGemini.so: undefined reference to TRandom::Gaus(double, double)' ./.libs/libGemini.so: undefined reference toTRandom3::TRandom3(unsigned int)’
./.libs/libGemini.so: undefined reference to TRandom::BreitWigner(double, double)' ./.libs/libGemini.so: undefined reference toTRandom3::Rndm()’
./.libs/libGemini.so: undefined reference to `TRandom3::~TRandom3()’
collect2: error: ld returned 1 exit status
Makefile:564: recipe for target ‘testDecay’ failed
make: *** [testDecay] Error 1

Thanks in advance.

Move ROOT libraries to the end of your link command line (i.e. to after all you own objects and libraries).

Thank you for your message but can you please elaborate on the path where i should put root libraries.

ROOT Forum -> Search -> “`root-config --libs`”

may be i m not doing it right but i have reinstalled root with prefix “/usr/local/bin” as described in some other post on this forum but still getting the same error. Makefile of gemini (Root version) shows all the correct paths to root libraries.

It’s not about where you keep your ROOT distribution. It’s about the order of your own object files and libraries versus ROOT libraries (they must come last) in the link command line of your “testDecay” application.

it worked. Thank you very much.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.