the change consists in the fact that the ROOT6 interpreter is based on a real compiler and does not parse line by line the code it’s fed with.
In this case
The interpreter has no means to know what symbol is “func”, in fact it would be available only at runtime only after parsing func.C.
There are of course ways to reformulate your code, for example you could add a ‘#include “func.C”’ to the file where you implement the “plot” function.