Windows 10: Clang, "stdio.h" not found

I installed LLVM and Clang-3.9.0 on Win10. I also installed MinGW.

I put my C code in the "D:" drive.

I can use gcc and g ++ to compile my code. But when I use clang, I get:

clang -cc1 version 3.9.0 based upon LLVM 3.9.0 default target x86_64-pc-windows-msvc ignoring duplicate directory "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A" ignoring duplicate directory "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A" #include "..." search starts here: #include <...> search starts here: C:\Program Files\LLVM\bin\..\lib\clang\3.9.0\include C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A End of search list. hello.c:1:10: fatal error: 'stdio.h' file not found #include "stdio.h" ^ 1 error generated. 

How can I use gcc and g ++, my environment variable settings are right. But then I can not get clang to look into C: \ MinGW.

I tried to copy all MinGW folders manually to C:\Program Files\LLVM\bin\ and \lib\clang\3.9.0\include separately, but this did not work. I wanted to try this one , but in 3.9.0 I cannot find clang/lib/Frontend/InitHeaderSearch.cpp .

Anyway, is there any work around?

Note. I tried <stdio.h> and "stdio.h" both, and I still get the same error.

+6
source share
1 answer

Ok, so still things with Clang / LLVM on Windows. Starting from 3.7 or so, everything has changed: Clang / LLVM binaries are created using Visual Studio and Visual Studio. As far as I know, there is no need for MinGW.

So now install LLVM through the available binaries. Make sure you have VS2015 (or 2013 and more) that were installed previously. When LLVM is installed, add it to the path when prompted.

Now, after all this, run the invitation of the development commander for VS2015 (it turned out start → Visual Studio 2015 → Developer Commander Prompt for VS2015 . I think you will choose any costumes for your requirements). Now from here try using the clang commands listed on the LLVM website .

However, commands such as lli , llvm-dis and llc still cannot be run.

In addition, the LLVM website still says that GNU tools for windows are needed. But I do not know why!

+2
source