I’m trying to use Jitting with Classes but am having issues. I’ve been trying to run the following test code (just to see if I can get it to work):
cpp_code = """
class TestClass
{
private:
int num;
public:
TestClass(int num);
int ReturnNum();
};
TestClass::TestClass(int num)
{
this->num = num;
}
int TestClass::ReturnNum()
{
return this->num;
}
"""
And then running:
ROOT.gInterpreter.ProcessLine(cpp_code)
mocm = ROOT.TestClass(17)
mocm.ReturnNum()
And the error message is:
input_line_53:17:12: error: qualified reference to ‘TestClass’ is a constructor name rather than a type in this context
TestClass::TestClass(int num)
^
input_line_53:17:26: error: expected ‘(’ for function-style cast or type construction
TestClass::TestClass(int num)
I’ve been able to get jitting to work for just straight up functions, but not for classes. What am I doing wrong?
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided