C++ vector issue - 'LNK2001: unresolved external symbol private: static...'
<p>Before anyone calls me out for not looking at pre-existing questions, I have looked and realise that it is to do with declaration, but I still can't get it to work (might be something to do with me using vectors).</p>

<p>Manager.h:</p>

<pre><code>#include "Flight.h"
#ifndef manager_h
#define manager_h

class Manager {
    static vector&lt;Airport&gt; airports;
    static vector&lt;Flight&gt; flights;
public:
    static void loadAirports();
    static void loadFlights();
    static Airport getAirport(string code);
    static vector&lt;string&gt; split(const string &amp;s, vector&lt;string&gt; &amp;elems);
};

#endif
</code></pre>

<p>Manager.cpp:</p>

<pre><code>#include "Manager.h"

void Manager::loadAirports ()
{
    ifstream airportfile("airports.txt");
    string line;
    while (getline(airportfile, line))
    {
        vector&lt;string&gt; values;
        split(line, values);
        Airport airport (values[0], values[1], atoi(values[2].c_str()));
        airports.push_back(airport);
    }
}

void Manager::loadFlights ()
{
    ifstream flightfile("flights.txt");
    string line;
    while (getline(flightfile, line))
    {
        vector&lt;string&gt; values;
        split(line, values);
        Flight flight (getAirport(values[0]), getAirport(values[1]), atoi(values[2].c_str()), atoi(values[3].c_str()));
        flights.push_back(flight);
    }
    cout &lt;&lt; flights.size() &lt;&lt; endl;
}

Airport Manager::getAirport (string code)
{
    for (int i = 1; i &lt; (int)airports.size(); i++)
    {
        if (airports[i].code == code)
            return airports[i];
    }
    throw exception();
}

vector&lt;string&gt; Manager::split(const string &amp;s, vector&lt;string&gt; &amp;elems) {
    stringstream ss(s);
    string item;
    while(getline(ss, item, ',')) {
        elems.push_back(item);
    }
    return elems;
}
</code></pre>

<p>It is throwing this error:</p>

<blockquote>
  <p>Manager.obj : error LNK2001:
  unresolved external symbol "private:
  static struct Vector
  Manager::airports"
  (?airports@Manager@@0U?$Vector@UAirport@@@@A)</p>
  
  <p>Manager.obj : error LNK2001:
  unresolved external symbol "private:
  static struct Vector
  Manager::flights"
  (?flights@Manager@@0U?$Vector@UFlight@@@@A)</p>
</blockquote>

<p>I realise i need to define the vectors, but how and where? I tried creating an empty constructor and then doing</p>

<pre><code>Manager::Manager ()
{
    vector&lt;string&gt; flights;
    vector&lt;string&gt; airports;
}
</code></pre>

<p>But it just gave me a re-definition error.</p>
