I have a header file myFunction.h, defined a function prototype wroten by myself. And I implemented this function in a cpp file myFunction.cpp. How can I use the function in my ROOT macro? Like:
#include<myFunction.h>
void myMacro()
{
myFunction();
}
I’m new to ROOT and C++, sorry.
#include "myFunction.h"
or
#include "/full/path/to/myFunction.h"
I see. It should be okay to use <> when the myFunction.h in the same path of myMacro.cpp. But even if I use “”, it still tells me that the function is not defined.
I think this may be because the file myFunction.cpp is not read correctly. What should I do?
Start by searching online and reading about including stuff in C++ (probably not a ROOT issue). E.g. Headers and Includes: Why and How - C++ Articles