it seems like i cannot have multiple function (or class) definition in the following use case.
for example, without the int g
line, the code works. but with that line, I got error: function definition is not allowed here
.
is there any workaround for this (or i just not fully understand this function)?
cpp_code = """
// Function definition
int f(int i) { return i*i; }
int g(int j) { return j*j; }
// Class definition
class A {
public:
A() { cout << "Hello PyROOT!" << endl; }
};
"""
ROOT.gROOT.ProcessLine(cpp_code)
_ROOT Version:_6.24 (conda-forge)
Platform:* centos
Compiler:* gcc9