Hello Philippe, Yes, I noticed this. I forgot to mention following pragmas. #pragma link C++ namespace MDL; #pragma link C++ namespace MDL::WAB; For your information Cint handles namespace as a kind of struct which has only static member. So '#pragma link C++ class' and '#pragma link C++ namespace' are analogious. Thank you Masaharu Goto > >Hi Masa, > >Your solution does work perfectly for class but does not work for function. >Some equivalent to > #pragma link C++ nestedfunction; >is probably needed. > >Philippe. > >> -----Original Message----- >> From: owner-roottalk@pcroot.cern.ch >> [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Masaharu Goto >> Sent: Tuesday, April 04, 2000 4:50 PM >> To: langston@SLAC.stanford.edu >> Cc: roottalk@pcroot.cern.ch >> Subject: RE:[ROOT] ROOT 2.23.12: Accessing functions >> >> >> Hello Matthew, >> >> You need to use >> >> #pragma link C++ nestedclass; >> #pragma link C++ nestedtypedef; >> >> together with what you have tried. There is a historical reason that >> cint does not activated nested classes by default. >> >> Thank you >> Masaharu Goto >> >> > >> >How do I export a function, which is nested in a namespace, from a >> >shared library so that it is available from the CINT interpreter? >> > >> >Here is a concrete example of the function that I am trying to export >> >from a shared library to CINT. The function, named "cross_section" (see >> >below), is nested inside of multiple namespaces. Here is the contents >> >of the header file which declares "cross_section": >> > >> > // cross_section.hxx >> > namespace MDL >> > { >> > namespace WAB >> > { >> > double cross_section( double* variables, double* parameters ); >> > } >> > } >> > >> > >> >Finally, here is the relevant part of the LinkDef.h file that I am >> >trying to use to export "cross_section" from the shared library to the >> >CINT interpreter: >> > >> > >> > // LinkDef.h >> > #pragma link C++ function MDL::WAB::cross_section; >> > >> > >> >This doesn't work, as evidenced by the following error message when I >> >try to run rootcint on these two files: >> > >> > >> > $ rootcint -f cross_sectionDict.cxx -c cross_section.hxx LinkDef.h >> > Note: link requested for unknown function MDL::WAB::cross_section >> >FILE:LinkDef.h LINE:21 >> > >> > >> >The pragma that I used (above) was the most straightforward method I >> >could think of to export the function "cross_section". Since it didn't >> >work, I also tried various combinations of the pragmas documented in the >> >CINT Reference Manual
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:23 MET