I am trying to run this macro (taken from the root tutorial)
int myMacro(int k = 0)
{
cout << "The input parameter was " << k << endl;
return k;
}
$ root
which is saved in the macro directory.
This is the error I encounter
Warning: catmyMacro.cxxintmyMacro Syntax error?? D:\root_v5.34.36\macros\myMacro.cpp(2)
Error: Missing one of '*&,;=():}' expected at or after line 9.
Error: Unexpected end of file (G__fgetvarname():2) D:\root_v5.34.36\macros\myMacro.cpp(9)
*** Interpreter error recovered ***
This is my first macro, and I’m not sure what I’m doing wrong.
Thank you.
Error: Invalid type 'root' in declaration of 'myMacro' (tmpfile)(1)
Error: Invalid type 'root' in declaration of 'myMacro' (tmpfile)(1)
Error: Symbol root myMacro is not defined in current scope (tmpfile)(1)
Error: Failed to evaluate root myMacro.cpp
*** Interpreter error recovered ***