Hi,
I’m trying to make a shlib for custom classes so that i can use them in ROOT, but i’m having trouble loading up the shlib:
I get the following error
dlopen error: /home/ataffard/MyWork/AtlasOffline-Any/UCINtuple_devel05_rel15.4.0/lib/libAnaUtils.so: undefined symbol: _ZTV9NtAnaBase
Load Error: Failed to load Dynamic link library /home/ataffard/MyWork/AtlasOffline-Any/UCINtuple_devel05_rel15.4.0/lib/libAnaUtils.so
I’m compiling the classes via rootcint using a dictionary.
I’ve tried both linking all the lib that i can think of and making a .rootmap file without luck.
The problem is only NtAnaBase, since if i remove that from the dictionary just leaving TGuiUtils, I can load the lib just fine.
Any suggestions as to what i could possibly be missing…
Cheers
-a
Compilation output:
L/Atlas/AthenaSoft/sw/lcg/app/releases/ROOT/5.22.00d/slc4_ia32_gcc34/root/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic -O -m32 -lm /home/ataffard/MyWork/AtlasOffline-Any/UCINtuple_devel05_rel15.4.0/InstallArea/i686-slc4-gcc34-opt/lib/libNtuple.so -shared -O -Wall -fPIC -pthread -m32 -I/Atlas/AthenaSoft/sw/lcg/app/releases/ROOT/5.22.00d/slc4_ia32_gcc34/root/include -I/home/ataffard/MyWork/AtlasOffline-Any/UCINtuple_devel05_rel15.4.0/InstallArea/include/Ntuple/Ntuple:/home/ataffard/MyWork/AtlasOffline-Any/UCINtuple_devel05_rel15.4.0/UCIAnaCommon/AnaUtils/AnaUtils AnaUtilsDict.cxx -o libAnaUtils.so
Here’s what i have in the Makefile.
[code]ROOTCONFIG := root-config
ROOTCFLAGS := $(shell $(ROOTCONFIG) --cflags)
ROOTLDFLAGS := $(shell $(ROOTCONFIG) --ldflags)
ROOTLIBS := $(shell $(ROOTCONFIG) --libs)
ROOTGLIBS := $(shell $(ROOTCONFIG) --glibs)
HASTHREAD := $(shell $(ROOTCONFIG) --has-thread)
CXX = g++
CXXFLAGS = -O -Wall -fPIC $(ROOTCFLAGS) -I$(INCLUDE_DIR)
LD = g++
LDFLAGS = $(ROOTLIBS) -O $(ROOTLDFLAGS) -lm ${UCINTUPLE_DIR}/i686-slc4-gcc34-opt/lib/libNtuple.so
SOFLAGS = -shared
LIBS = $(ROOTLIBS) $(SYSLIBS)
GLIBS = $(ROOTGLIBS) $(SYSLIBS)
HDR = …/AnaUtils
LIB = libAnaUtils.so
$(LIB) : $(HDR)/AnaUtilsLinkDef.h
@rootcint -v3 -f AnaUtilsDict.cxx -c -I$(HDR) -I$(INCLUDE_DIR) -DDebug $(HDR)/NtAnaBase.h $(HDR)/AnaUtilsLinkDef.h
$(CXX) $(LDFLAGS) $(SOFLAGS) $(CXXFLAGS) AnaUtilsDict.cxx -o $@
@rm -f AnaUtilsDict.cxx AnaUtilsDict.h
@rlibmap -o libAnaUtils.rootmap -l libAnaUtils.so -d libNtuple.so -c ../AnaUtils/AnaUtilsLinkDef.h
@ln -sf ../UCIAnaCommon/AnaUtils/run/libAnaUtils.so $(UCIANA_LIB)/
@ln -sf ../UCIAnaCommon/AnaUtils/run/libAnaUtils.rootmap $(UCIANA_LIB)/
clean:; @rm -f $(LIB) libAnaUtils.rootmap AnaUtilsDict.cxx AnaUtilsDict.h core [/code]
Header of NtAnaBase.h
[code]#ifndef NTANABASE_H
#define NTANABASE_H
#include
#include
#include
#include
#include <TROOT.h>
#include “…/…/…/UCINtuple/Ntuple/Ntuple/NtupleInterface.h”
//#include “NtupleInterface.h”
#include “TGuiUtils.h”
class TStopwatch;
using namespace std;
class NtAnaBase : public NtupleInterface, public TGuiUtils
…
[/code]