I think is an old question but I don't get it.
I have a header routines.h, its functions file routines.cpp and the main file main.cpp.
In the header there is:
class myclass{
public:
static const double a;
void mymethod();
};
const double myclass::a=0.0;
The routines.cpp contains: #include"routines.h"
and then define the methods.
main.cpp also has #include"routines.h"
.
This setup gives a link error: a it's already defined.
public: static double const myclass::a" (?a148@myclass@@2NB) already defined in DBFLOWPAR2.obj
DBFLOWPAR2 is my main file.
If I define the methods in routines.h it works fine, but I don't like that. What else it's possible? I don't care how the variables are defined, I just want to be able to access myclass.a and find the right value in it.