title: mingw-w64 cannot link to boost
body: <p>I have installed <code>g++-mingw-w64-i686</code> to compile a <code>c++11</code> application for windows on linux:</p>
  
  <pre><code>sudo apt-get install g++-mingw-w64-i686
  sudo apt-get install libc6-dev-i386
  </code></pre>
  
  <p>I am wondering why it cannot link to boost</p>
  
  <p>main7.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main()
  {
      std::cout&lt;&lt;"Hello world!\n";
      return 0;
  }
  </code></pre>
  
  <p>compiling:</p>
  
  <pre><code>$ i686-w64-mingw32-g++ main7.cpp -Wfatal-errors -o main -std=c++11 -I'/usr/include/c++/4.9' -L'/usr/lib' -L'/usr/i686-w64-mingw32/lib' -lboost_system -lboost_thread -lboost_serialization -pthread
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>/usr/bin/i686-w64-mingw32-ld: cannot find -lboost_system
  /usr/bin/i686-w64-mingw32-ld: cannot find -lboost_thread
  /usr/bin/i686-w64-mingw32-ld: cannot find -lboost_serialization
  collect2: error: ld returned 1 exit status
  make: *** [all] Error 1
  </code></pre>
  
  <p>While <code>gcc</code> works:</p>
  
  <pre><code>g++ main7.cpp -Wfatal-errors -o main -std=c++11 -I'/usr/include/c++/4.9' -L'/usr/lib'  -lboost_system -lboost_thread -lboost_serialization -pthread
  </code></pre>
  
  <hr>
  
  <pre><code>$ g++ --version
  </code></pre>
  
  <blockquote>
    <p>g++ (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3</p>
  </blockquote>