I have a class in foo.h containing a static member
class foo {
public:
static vector<int> a;
static void Init() { // Init a }
}
Everything works fine until I have a testing file
foo_test.cpp which is testing class foo. But in the
testing file, the static member a is not visible because
static member is only visible… How do I solve this?
Thanks
You will need to define
a, in yourcppfile add a line like:Edit: changed the data type to reflect the edit in the question