title: Clang on Windows with MinGW
body: <p>I have both MinGW <code>gcc</code> and Clang <code>clang</code> installed and added to path via <code>chocolatey</code>, and both can be found on the command line. However, when I try to use <code>clang</code> with <code>gcc</code>, <code>clang</code> doesn't seem to know where to find header files in the standard library (such as <code>iostream</code>), returning the following error:</p>
  
  <pre class="lang-sh prettyprint-override"><code>clang++ -v main.cpp -o main.exe -std=c++14 -target x86_64-mingw64
  </code></pre>
  
  <pre><code>clang version 9.0.0 (tags/RELEASE_900/final)
  Target: x86_64-unknown-windows-gnu
  Thread model: posix
  InstalledDir: C:\Program Files\LLVM\bin
  (SKIP)
  ignoring nonexistent directory "(nonexistent directories)"
  #include "..." search starts here:
  #include &lt;...&gt; search starts here:
  C:\Program Files\LLVM\lib\clang\9.0.0\include
  End of search list.
  main.cpp:1:10: fatal error: 'iostream' file not found
  #include &lt;iostream&gt;
           ^~~~~~~~~~
  1 error generated.
  
  shell returned 1
  </code></pre>
  
  <p>I've added both <code>gcc</code> and <code>clang</code> to path, as well as the directory containing header files included in <code>gcc</code> (<code>C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0</code>), so I don't understand why <code>clang</code> isn't looking in the right place for the header files. How can I fix this problem? And this isn't really necessary, but can the default target for <code>clang</code> be changed? The current Windows 10 default for <code>clang</code> is <code>msvc</code>, but I'd rather not use it.</p>