title: Difference between Linux and Windows linker
body: <p>What is the difference in linking on various operating system?</p>
  
  <p>For example the following code produces a linker error on Windows (compiled both with Vs2010 and gcc), but compiles successfully on Linux (Ubuntu,gcc):</p>
  
  <pre><code>extern int foo
  
  int main() {
      foo=1;
  }
  </code></pre>
  
  <p>Gcc command:</p>
  
  <pre><code>gcc -shared filename.cpp
  </code></pre>