Dlopen problem with ACLiC

Hi I’m trying to compile and load a shared library with ACLiC but it gives the following error:

[quote]root [5] .L src/TFitFunctions.cpp++
Info in TUnixSystem::ACLiC: creating shared library /Users/xspec/TFitFunction/./src/TFitFunctions_cpp.so
/Users/xspec/TFitFunction/include/TFitFunctor.hpp:66: warning: unused parameter ‘x’
/Users/xspec/TFitFunction/include/TFitFunctor.hpp:66: warning: unused parameter 'par’
dlopen error: dlopen(/Users/xspec/TFitFunction/./src/TFitFunctions_cpp.so, 10): Symbol not found: __ZN13TFitFunctions8StreamerER7TBuffer
Referenced from: /Users/xspec/TFitFunction/./src/TFitFunctions_cpp.so
Expected in: dynamic lookup

Load Error: Failed to load Dynamic link library /Users/xspec/TFitFunction/./src/TFitFunctions_cpp.so
/Users/xspec/TFitFunction/include/TFitFunctor.hpp:66: warning: unused parameter ‘x’
/Users/xspec/TFitFunction/include/TFitFunctor.hpp:66: warning: unused parameter 'par’
powerpc-apple-darwin8-g+±4.0.0: libTTextToVector.dylib: No such file or directory
powerpc-apple-darwin8-g+±4.0.0: libTLombScargle.dylib: No such file or directory
*** Interpreter error recovered ***
[/quote]

I’ve used the ClssDef and ClassImp macros and the LinkDef file includes the line:

Where am I going wrong?

Hi,

You are missing the dictionary for TFitFunctions.
The default is for ACLiC is to generate the dictionary for C++ entities declare in the file and any header with the same name (i.e. TFitFunctions.cpp and TFitFunctions.h). Since your header file is named TFitFunctor.hpp, your dictionary is not generated. Also even though you mention a linkdef, I am guessing you have not included it in TFitFunctor.hpp nor in TFitFunctions.cpp and hence ACLiC (actually rootcint called by ACLiC) does not see unless you call it TFitFunctions_linkdef.h.

To solve you problem simply add the following lines at the end of TFitFunctions.cpp:#ifdef _MAKECINT__ #pragma link C++ class TFitFunctions+; // The '+' request the newer I/O implementation #endif

Cheers,
Philippe.