Hi,
I am getting an error I do not understand. When I run this program as a standalone C++ app everything works fine but when I run it under root it gives me the following error:
root [0] .L libraries.C
root [1] .x fitlength.C
dlopen error: /afs/fnal.gov/files/code/e875/rhbob/nova/fortran/reco/socal/lib/libRecoEvent.so: undefined symbol: _ZN16LongitudinalBlobC1Ev
Load Error: Failed to load Dynamic link library /afs/fnal.gov/files/code/e875/rhbob/nova/fortran/reco/socal/lib/libRecoEvent.so
*** Interpreter error recovered ***
What is obvious here is that the LongitudinalBlob object is defined in a different directory from RecoEvent above (libRecoEvent.so); it is defined in the NeuralBlob directory.
Now libraries.C containes the NeuralBlobs.so which contains the LongitudinalBlob object:
gSystem->Load(“libPhysics”);
gSystem->Load("$SOCAL_DIR/lib/libEvent.so");
gSystem->Load("$SOCAL_DIR/lib/libMessage.so");
gSystem->Load("$SOCAL_DIR/lib/libReadoutSim.so");
gSystem->Load("$SOCAL_DIR/lib/libConnectionMap.so");
gSystem->Load("$SOCAL_DIR/lib/libDisplay.so");
gSystem->Load("$SOCAL_DIR/lib/libREROOT_Classes.so");
gSystem->Load("$SOCAL_DIR/lib/libGeometry.so");
gSystem->Load("$SOCAL_DIR/lib/libConfig.so");
gSystem->Load("$SOCAL_DIR/lib/libPhotonTransport.so");
gSystem->Load("$SOCAL_DIR/lib/libREROOT_Classes.so");
gSystem->Load("$SOCAL_DIR/lib/libGeometry.so");
gSystem->Load("$SOCAL_DIR/lib/libNeuralBlobs.so");
gSystem->Load("$SOCAL_DIR/lib/libRecoEvent.so");
gSystem->Load("$SOCAL_DIR/lib/libTruthFilter.so");
and I have LongitudinalBlob in the LinkDef.hh:
#ifdef CINT
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ namespace SoCal;
#pragma link C++ class LongitudinalBlob+;
#pragma link C++ class BlobResult+;
#pragma link C++ class NeuralBlob+;
#endif
Running as a standalone program means I have the following in my .cxx:
#include
#include
#include
#include
#include <TMath.h>
#include “ShowerFcn.h”
#include “Minuit2/FCNBase.h”
#include “Minuit2/MnUserTransformation.h”
#include “Minuit2/MinuitParameter.h”
#include “Minuit2/MnUserParameters.h”
#include “Minuit2/MnMigrad.h”
#include “Minuit2/FunctionMinimum.h”
#include “Minuit2/MnMinos.h”
#include “TRandom3.h”
#include “TH1.h”
#include “TF1.h”
#include “TVirtualFitter.h”
#include “TStyle.h”
#include “TFitterMinuit.h”
#include “TSystem.h”
#include “TTree.h”
#include “TCanvas.h”
#include “TBranch.h”
#include “TBrowser.h”
#include “/afs/fnal.gov/files/code/e875/rhbob/nova/fortran/reco/socal/NeuralBlobs/LongitudinalBlob.h”
#include “/afs/fnal.gov/files/code/e875/rhbob/nova/fortran/reco/socal/NeuralBlobs/BlobResult.h”
using namespace std;
using namespace ROOT::Minuit2;
and the code works perfectly – no problem with LongitudinalBlob. I would guess somehow I am not telling ACLiC or CINT the right thing, but I have no idea what. The fact that if I just run it outside of ROOT everything is OK tells me I am using ROOT incorrectly.
–thanks, Robert Bernstein