[ROOT] Re: your mail

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Oct 21 2002 - 12:01:59 MEST


Hi Benoit,

If you want to call a function in a shared lib from CINT,
the dictionary must be available.

If you do not want to run rootcint yourself, you can use ACLIC
to do this automatically for you by doing:
root > .L test.cc++
root > truc()

Rene Brun


On Mon, 21 Oct 2002, Benoit Revenu wrote:

> dear all,
> 
> is it possible to load a shared library made of some functions (no
> classes) without making a dictionnary ? I would like to obtain the same
> behavior than using .L source.cc but using .L libsource.so.
> 
> for instance:
> cat test.cc:
> #include <iostream>
> void truc()
> {
> cout << "hello" << endl;
> }
> 
> then build libtruc.so with
> g++ test.cc -c -o test.o
> then
> g++ -shared test.o -o libtruc.so
> 
> then, in ROOT,
> .L libtruc.so // is ok
> but
> truc() fails :
> root [0] .L libtruc.so
> root [1] truc()
> Error: Function truc() is not defined in current scope
> FILE:/tmp/fileYEaRUQ_cint LINE:1
> Possible candidates are...
> filename       line:size busy function type and name  
> *** Interpreter error recovered ***
> 
> but
> root [0] .L test.cc
> root [1] truc()
> hello
> 
> works fine !
> 
> 
>                 Benoît
> 
> -------------------------------------------------------------------------------
> GReCO / IAP
> (+33) (0) 1 44 32 81 79
> -------------------------------------------------------------------------------
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:15 MET