I found this post that describes how to build a CINT dictionary for GSL (http://root.cern.ch/phpBB2/viewtopic.php?t=4730&highlight=gsl). It works fine with gsl_sf_bessel.h (the header used in the example), but if I try it with a different header I get “… is not defined in current scope” when I try to use some functionality of the library.
For example:
root [0] gSystem->Load("/usr/lib/libgsl.so");
root [1] gSystem->Load("/usr/lib/libgslcblas.so");
root [2] gSystem->SetIncludePath("-I/usr/include");
root [3] gROOT->ProcessLine(".L /usr/include/gsl/gsl_math.h+");
Warning in <ACLiC>: /usr/include/gsl is not writeable!
Warning in <ACLiC>: Output will be written to /tmp/foobie
Info in <TUnixSystem::ACLiC>: creating shared library /tmp/foobie//usr/include/gsl/gsl_math_h.so
root [4] printf("Should be 9: %d\n", int(gsl_pow_2(3)));
Error: Function gsl_pow_2(3) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
Ahhh, the problem was that the function was actually defined in “gsl/gsl_pow_int.h” which was an included header in “gsl/gsl_math.h”. Thanks for the help.
You say that that is the default behavior of ACLiC. Is there an easy way to make it also generate the dictionary for included header files? I read chapter 7 of the user’s guide and the answer to this still wasn’t clear to me. It doesn’t make a huge difference, but it would be convenient.
[quote]Is there an easy way to make it also generate the dictionary for included header files?[/quote]Sorta (you would need to turn on default pragma linking and write a linkdef for your file for ACLiC) but this is not what you want . This would generate the dictionary for every single header it sees including all the system headers.
There is a directive that you can use #pragma link C++ defined_in filename; to create a custom file (that would #include and #pragma link all the needed headers) but in older version of ROOT the filename needed to be a full path name.
The easiest is simply to .L filename.h+ all the header you need.