title: mingw g++ is unable to link with libraries
body: <p>I'm trying to use <code>X86_64-w64-mingw32-g++</code> (packaged in Archlinux's MingW package) to cross compile some C++ code into an Windows executable, however I'm having trouble getting past some issues. </p>
  
  <p>I'm calling</p>
  
  <pre><code>x86_64-w64-mingw32-g++ -o build_win/asm build_win/asm.o build_win/asm_lib.o build_win/socket_boost.o -I../extra/etc -fopenmp -lrt -std=c++11 -g -lboost_system -lboost_serialization 
  </code></pre>
  
  <p>from a makefile, but I get thrown the errors:</p>
  
  <pre><code>/usr/lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lrt
  /usr/lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lboost_system
  /usr/lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lboost_serialization
  </code></pre>
  
  <p>This works fine with native g++, so exactly do I have to change for mingw to compile?</p>
  
  <p>EDIT: I have <code>mingw-w64-boost</code> package installed, which includes boost libraries pre-compiled and ready to be linked. However, it seems the naming convention is a bit different, and <code>-lboost_system</code> for example becomes <code>-llibboost_system-mt</code> (not exactly sure what the -mt suffix entails).</p>
  
  <p>Problem is I can't find the mingw counterpart for <code>-lrt</code>. I've tried with both <code>-lrtm</code> and <code>-lrtutils</code> but in both cases I get:</p>
  
  <pre><code>[...] 
  undefined reference to `__imp_getsockopt'
  </code></pre>