I'm doing a little project after a long period of no c++, so please forgive me for any possible stupid mistakes.
Basically I have 2 cpp files, in first.cpp I define namespace 'myNS', and in second.cpp I define class 'myClass'. The problem is that I have a pointer of type myClass* in the namespace, and I need variables from the namespace in the myClass. So the 2 files look something like this:
myNS::justAnyNumber = 5; // Error here
When I compile this code I the error "myNS has not been declared". Now I understand that in this structure, the compiler/linker is trying to compile second.cpp before is reaches the definition of the namespace, but I'm still clueless on how to solve this issue.
Any ideas on how to solve this?