Dyld: lazy symbol binding failed: Symbol not found: __ZN5TTr

Hi all.

I am trying to write a simple class that will assist in reading/writing a TFile for my experiment.

I’ve added the class to the ROOTSYS/test/Event.h and .cxx files and compiled it into libEvent.so.

When I try to load the class in the CINT, that works fine, but it breaks when it tries to create a TTree with the error given in the CINT to be:

root [0] gSystem->Load("libEvent.so");
root [1] EdwTreeIO mIO        
root [2] TFile *f = mIO.OpenFileForWriting("test.root", "recreate", "Edw File", 1)
EdwTreeIO : Open File test.root
EdwTreeIO::CreateTree()
dyld: lazy symbol binding failed: Symbol not found: __ZN5TTreeC1EPKcS1_i
  Referenced from: /Users/adam/softwareDev/root/development/test/./libEvent.so
  Expected in: flat namespace

dyld: Symbol not found: __ZN5TTreeC1EPKcS1_i
  Referenced from: /Users/adam/softwareDev/root/development/test/./libEvent.so
  Expected in: flat namespace

7:08pm /Users/adam/softwareDev/root/root/test:

You can see that it kills the CINT and returns me to a command prompt. (The first two lines of output “EdwTreeIO : Open File test.root” and “EdwTreeIO::CreateTree()” are from my code."). It breaks on line 491 of the attached Event.cxx file.

I am using the latest version from svn, and have this same problem with 5.26.00b, and am running on a mac os 10.6.3.

Can somebody tell me what my problem is and how to fix it?

Attached is are my example files Event.h, Event.cxx, EventLinkDef.h

Thanks,
Adam
EventLinkDef.h (294 Bytes)
Event.cxx (16.6 KB)
Event.h (8.72 KB)

It is likely that you have a problem in the way you build libEvent.so.
I suggest to simply go via ACLIC as shown below

Rene

root [0] .L Event.cxx+ root [1] EdwTreeIO mIO root [2] TFile *f = mIO.OpenFileForWriting("test.root", "recreate", "Edw File", 1) EdwTreeIO : Open File test.root EdwTreeIO::CreateTree() Made Tree fTree = 0x101916400 root [3]

Hi Rene. Thanks for the reply.

I used the Makefile found in the ROOTSYS/test directory without any modification.

I’d like to use this class inside of a larger project and would like to compile it without ACLiC.

Thanks,
Adam

Hi,

You need to executegSystem->Load("libTree");

Philippe.

Thanks for the answer!

So, is there a way that I can load the libTree library when I load my libEvent? I’m trying to reduce the overhead to use these classes (in order to more easily convince my colleagues to adopt them.)

Adam

Hi Adam,

There is 2 ways, you could hard link libTree to you library (i.e. put -lTree to your library link line) or you could write a rootmap file either by hand or using rlibmap :Usage: bin/rlibmap [-f] [<-r|-o> <mapfile>] -l <sofile> -d <depsofiles> -c <linkdeffiles>eg:bin/rlibmap -o lib/libTreePlayer.rootmap -l lib/libTreePlayer.so \ -d lib/libTree.so lib/libGraf3d.so lib/libGraf.so lib/libHist.so lib/libGpad.so lib/libRIO.so lib/libMathCore.so -c tree/treeplayer/inc/LinkDef.h

Cheers,
Philippe.