Hi Yvonne,
[Put it on roottalk as it's ROOT centric]
Yvonne Becherini <Yvonne.Becherini@bo.infn.it> wrote concerning
Re: [CINT] cint help!?! [Fri, 07 Feb 2003 15:48:07 +0000 (UTC)]
----------------------------------------------------------------------
>
> Thank you for the help Christian,
>
> if I type:
>
> nm libevent.so | grep -e "^ *U "
>
> I get a huge list of symbols.
Did you see any member functions of the event class as undefined? If
so, you better implement them! Do
nm -C libevent.so | grep -e "^ *U " | grep "event"
(Note that the `-C' option gives more human-readable output)
> I did some very small changes in the source and now the root macro stops
> when it trying to build the event object and I have the following message
> under root:
>
> /usr/local/root/bin/root.exe: relocation error: libevent.so: undefined symbol: __5event
Your problem lies at the linking/compilation stage.
* Check that _all_ member functions are defined either inline or in a
compiled source file. One thing that often happens, is that people
forget a constructor or the destructor
class foo {
...
public:
foo(); // This should be implemented in a source file or inline
~foo(); // This should be implemented in a source file or inline
...
};
* Check that all the `ROOT-centric' member functions are defined.
Sometimes people forget to use the ClassImp macro
// `Header' (or declaration) file
class foo {
...
ClassDef(foo,0) // If you use this, you _must_ use ClassImp too
};
// `Source' (or definition) file
ClassImp(foo);
* Check that you link all the object files into the library.
Sometimes people forget the CINT generated file.
rootcint -f fooDict.cxx -c foo.h
g++ `root-config --cflags` -c -Wall -g foo.cc
g++ `root-config --cflags` -c -Wall -g fooDict.cxx
g++ -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.1 foo.o fooDict.o
ln -s libfoo.so.1.1 libfoo.so.1
ln -s libfoo.so.1 libfoo.so
* Watch out for the optimisation used by `GCC' 2.96-RH on SMP
machines - don't go higher than 1 (option -O1) as it may strip some
inline member function, and those need to be defined when loading
the library into a ROOT interactive session.
* Check that the header file has the same name as the class you're
generating a dictionary for. If your header is `foo.h' CINT will
assume that you want a dictionary for the class `foo'
_and_nothing_else_. If your header files base name isn't the same
as the class name, or you need to create dictionaries for multiple
classes in one go, you need a `linkdef' file
#ifndef __CINT__
#error Not for compilation
#endif
#pragma link off all functions;
#pragma link off all globals;
#pragma link off all classes;
#pragma link C++ class foo+;
#pragma link C++ class bar+;
#pragma link C++ class baz+;
and pass that file as the last argument to rootcint
rootcint -f fooDict.cxx -c header.h linkdef.h
Hope those points help you out.
Yours,
___ | Christian Holm Christensen
|_| | -------------------------------------------------------------
| | Address: Sankt Hansgade 23, 1. th. Phone: (+45) 35 35 96 91
_| DK-2200 Copenhagen N Cell: (+45) 24 61 85 91
_| Denmark Office: (+45) 353 25 305
____| Email: cholm@nbi.dk Web: www.nbi.dk/~cholm
| |
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET