ROOT 5.34/09 (v5-34-09@v5-34-09, Jun 26 2013, 17:10:36 on linux) Arch Linux.
I’m trying to use XYZPoint in a macro but when I compile it using ACLiC:
Info in TUnixSystem::ACLiC: creating shared library /home/rmason/test/root/./lattex_C.so
In file included from /home/rmason/test/root/lattex_C_ACLiC_dict.h:34:0,
from /home/rmason/test/root/lattex_C_ACLiC_dict.cxx:17:
/home/rmason/test/root/./lattex.C: In function ‘void lattex()’:
/home/rmason/test/root/./lattex.C:40:3: error: ‘XYZPoint’ is not a member of ‘ROOT::Math’
ROOT::Math::XYZPoint v(0.0,0.0,0.0);
Trying this in CINT:
root [0] XYZPoint p(1,2,3)
Error: Invalid type ‘XYZPoint’ in declaration of ‘p’ (tmpfile):1:
Error: Function XYZPoint p(1,2,3) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
I have ROOT 5.34.11, but think this should also work with the version you have.
I believe, XYZPoint is a part of ‘genvector’ library (I’m not sure, may be it’s always enabled by default) so you probably have to check if it was built at all - have a look at config.log, for example or check that you have libGenVector in your lib directory.
root [0] XYZPoint p(1,2,3)
Error: Invalid type ‘XYZPoint’ in declaration of ‘p’ (tmpfile):1:
Error: Function XYZPoint p(1,2,3) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
root [1] ROOT::Math::XYZPoint p(1,2,3)
Error: Syntax error (tmpfile):1:
*** Interpreter error recovered ***
root [2] ROOT::Math::XYZPoint p(0., 0., 0.);
root [3] ROOT::Math::XYZPoint p(1.0,2.0,3.0)
root [4] using namespace ROOT::Math
root [5] XYZPoint p(1,2,3)
So, using XYZPoint with integers does not work unless the namespace is declared. Here’s what happens if the namespace is declared and a constructor with floats is used:
root [0] XYZPoint p(1,2,3)
Error: Invalid type ‘XYZPoint’ in declaration of ‘p’ (tmpfile):1:
Error: Function XYZPoint p(1,2,3) is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
root [1] ROOT::Math::XYZPoint p(1,2,3)
Error: Syntax error (tmpfile):1:
*** Interpreter error recovered ***
root [2] ROOT::Math::XYZPoint p(0., 0., 0.);
root [3] ROOT::Math::XYZPoint p(1.0,2.0,3.0)
root [4] using namespace ROOT::Math
root [5] XYZPoint p(1,2,3)
So, using XYZPoint with integers does not work unless the namespace is declared. Here’s what happens if the namespace is declared and a constructor with floats is used:
I have no idea what is going on or if I should trust XYZPoint.
Roger[/quote]
You can trust ACLiC’ed version of your code for sure.
Also, as I’ve just noticed, you can do gSystem->Load(“libGenVector.so”) and everything works - default ctors, using directives, ints as ctor arguments instead of doubles etc.