title: Msys2 and Clang on Windows: iostream file not found
body: <p>I followed this tutorial (<a href="http://blog.johannesmp.com/2015/09/01/installing-clang-on-windows-pt1/" rel="nofollow noreferrer">here</a>) to get Clang working on windows. I choose the path to install clang in combination with msys2. </p>
  
  <p>After following all instructions I wrote the simple programme:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {   
  cout&lt;&lt;"Hello, World!\n";
  return 0;
  }
  </code></pre>
  
  <p>After compiling with:
  clang++ Helloworld.cpp -o Helloworld.exe -std=c++14</p>
  
  <p>I get the error: </p>
  
  <blockquote>
    <p>*Helloworld.cpp:2:10: fatal error: 'iostream' file not found, </p>
    
    <p>1 error generated.*</p>
  </blockquote>
  
  <p>Adding -v in the command line I get:</p>
  
  <p><a href="https://i.stack.imgur.com/g6E8a.png" rel="nofollow noreferrer">Errors</a></p>
  
  <pre><code>clang version 3.9.1 (tags/RELEASE_391/final) 
  Target: x86_64-w64-windows-gnu
  Thread model: posix
  InstalledDir: C:\msys64\mingw64\bin     
  "C:\\msys64\\mingw64\\bin\\clang++.exe" -cc1 -triple x86_64-w64-windows-gnu -emit-obj -mrelax-all -disable-free -disable-    llvm-verifier -discard-value-names -main-file-name Helloworld.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v -dwarf-column-info -debugger-tuning=gdb -resource-dir "C:\\msys64\\mingw64\\bin\\..\\lib\\clang\\3.9.1" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\x86_64-w64-mingw32" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\backward" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\\\x86_64-w64-mingw32" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\\\backward" -internal-isystem "C:\\msys64\\mingw64\\include\\c++\\" -internal-isystem "C:\\msys64\\mingw64\\include\\c++\\\\x86_64-w64-mingw32" -internal-isystem "C:\\msys64\\mingw64\\include\\c++\\\\backward" -internal-isystem "include\\c++" -internal-isystem "include\\c++\\x86_64-w64-mingw32" -internal-isystem "include\\c++\\backward" -internal-isystem "C:\\msys64\\mingw64\\bin\\..\\lib\\clang\\3.9.1\\include" -internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include" -internal-isystem "C:\\msys64\\mingw64\\include" -std=c++14 -fdeprecated-macro -fdebug-compilation-dir "C:\\msys64\\programming" -ferror-limit 19 -fmessage-length 0 -femulated-tls -fno-use-cxa-atexit -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o "C:\\msys64\\tmp\\Helloworld-2393e7.o" -x c++ Helloworld.cpp
  
  clang -cc1 version 3.9.1 based upon LLVM 3.9.1 default target x86_64-w64-windows-gnu
  ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++"
  ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++\x86_64-w64-mingw32"
  ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++\backward"
  ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++\"
  ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++\\x86_64-w64-mingw32"
  ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include\c++\\backward"
  ignoring nonexistent directory "C:\msys64\mingw64\include\c++\"
  ignoring nonexistent directory "C:\msys64\mingw64\include\c++\\x86_64-w64-mingw32"
  ignoring nonexistent directory "C:\msys64\mingw64\include\c++\\backward"
  ignoring nonexistent directory "include\c++"
  ignoring nonexistent directory "include\c++\x86_64-w64-mingw32"
  ignoring nonexistent directory "include\c++\backward"
  ignoring nonexistent directory "C:\msys64\mingw64\x86_64-w64-mingw32\include"
  #include "..." search starts here:
  #include &lt;...&gt; search starts here:
   C:\msys64\mingw64\bin\..\lib\clang\3.9.1\include
   C:\msys64\mingw64\include
  End of search list.
  Helloworld.cpp:2:10: fatal error: 'iostream' file not found
  #include &lt;iostream&gt;
           ^
  1 error generated.
  </code></pre>
  
  <p>How do I get the system to find iostream? I read something about,that you have to point to the mingw headers in clang/lib/Frontend/InitHeaderSearch.cpp. I couldn't find the file InitHeaderSearch.cpp on my computer. </p>
  
  <p>Thank you for your help.</p>
  
  <p>Windows 8
  Clang 3.9.1</p>