Error in including a Global Vector when used in multiple files
<pre><code>// Main.cpp
#include &lt;iostream&gt;
#include "common.h"
#include "second.cpp"
#include &lt;vector&gt;

int main(){
  global = 10;
  ip.push_back("TestTest");
  std::cout &lt;&lt; global &lt;&lt; std::endl;
  TestClass t;
  t.print();
}

//common.h
#ifndef GLOBAL_H
#define GLOBAL_H
#include &lt;vector&gt; 
#include &lt;string&gt;
extern int global;
extern std::vector&lt;std::string&gt; ip ; 
#endif

// second.cpp

#include &lt;iostream&gt;
#include "common.h"

int global;

class TestClass{

  public:
    void print();};
void TestClass::print(){
  global++;
  std::cout &lt;&lt; "Global: "&lt;&lt;global &lt;&lt; std::endl;
  std::cout &lt;&lt; "IP String: "&lt;&lt;ip[0] &lt;&lt; std::endl;
}

// Console Error
ubuntu:deleteme$ g++ main.cpp
/tmp/ccoJpYRl.o: In function `TestClass::print()':
main.cpp:(.text+0x55): undefined reference to `ip'
/tmp/ccoJpYRl.o: In function `main':
main.cpp:(.text+0xdd): undefined reference to `ip'
collect2: error: ld returned 1 exit status
</code></pre>

<p>The above works when I am just using with the <code>int global</code> variable. However when I added a vector <code>ip</code> to the <code>common.h</code> I am getting the showed error. </p>

<p>This seems like a elemental thing but couldn't get an answer. </p>

<p>Thanks in advance :)</p>
