Hi,
I have no problem creating a static member variable with integers, etc but
when I try the same with a vector then I always get linker errors that the
static member variable is unknown (unresolved external symbol)
Below is what an example of the code I use. Can somebody tell me what I am
doing wrong ?
Thanks very much in advance,
Serge
//myclass.h
//header file
#include <vector>
using namespace std;
class myclass
{
public:
static void my_method (int new_value);
private:
static vector<int> m_variable_v; //static member variable
};
//myclass.cpp
//cource code class
#include "myclass.h"
using namespace std;
//define static member variables
vector<int> m_variable_v;
void myclass::my_method(int new_value)
{
m_variable_v.push_back(new_value);
}