title: Cross compile modern C++ from Linux to Windows
body: <p>I have some modern C++ sources (C++17, say) and I have no problem compiling complex source base on Linux for Linux 32/64, and on Windows for Windows 32/64 using mingw-w64 (from msys2).</p>
  
  <p>Now I want to cross compile for Windows on Linux, to avoid using a virtual machine just to compile.</p>
  
  <p>So I tried installing mingw-w64 from the Ubuntu repository, but it was compiled with <code>--enable-threads=win32</code>, which is not compatible with <code>std::mutex</code>, for instance, from C++11.</p>
  
  <p>I wasn't able to compile <code>mingw-w64-v7</code> from source (it only compiles a bunch of libraries and not the compiler itself), I wasn't able to get a single binary already compiled for Linux 64bits either.</p>
  
  <p>What is the way to go to setup a cross compiling toolchain that compiles modern C++ from Linux to get Windows 32 and 64 bits executables?</p>