title: g++ linker problem
body: <p>I am trying to understand the keyword extern in C++ and wrote a short code to outline the meaning. Unfortunately I am doing something wrong</p>
  
  <p>bla.h</p>
  
  <pre><code>int bla = 4;
  </code></pre>
  
  <p>test.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main() {
         extern int bla;
         cout &lt;&lt; bla &lt;&lt; endl;
  }
  
  g++ -o test bla.h test.cpp
  /tmp/ccED67jz.o: In function `main':
  test.cpp:(.text+0xa): undefined reference to `bla'
  collect2: ld returned 1 exit status
  </code></pre>