you should avoid globals. They are never really necessary (espacially in oF!)
But here's what's going on:
each .cpp file is compiled independently, so one is not aware of the contents of the other. To resolve this problem we use header files, which contain information about the contents of a .cpp.
To achieve what you want in oF you should do as @hubris recommended. Or, if you really want to use your function, just replace his setup code for yours.