If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
No, you don't have to set it global. But even if you did, you wouldn't do it in a header file as these get included into multiple compilation units causing mutliple declaration problems as the one you're suffering from right now. I think this is a good moment to suggest spending some time with a good book on object-oriented programming before tackling real problems.
Bookmarks