I installed clang with Visual Studio and then built the highlighted project as it\'s said in the documentation.
The build was successful, however when I try
Yes, I have an idea. Remove -cc1 or . According to the clang FAQ this is your error. It states quite explicitly, giving your precise example:
$ clang -cc1 hello.c hello.c:1:10: fatal error: 'stdio.h' file not found #include^ 1 error generated.
Reading on, it gives other alternative solutions, as well as a useful explanation, which you should certainly read in its entirety, since it's our job as programmers to read the manuals for the technology we use.
clang -cc1is the frontend,clangis the driver. The driver invokes the frontend with options appropriate for your system. To see these options, run:$ clang -### -c hello.cSome
clangcommand line options are driver-only options, some are frontend-only options. Frontend-only options are intended to be used only by clang developers. Users should not runclang -cc1directly, because-cc1options are not guaranteed to be stable.If you want to use a frontend-only option (“a
-cc1option”), for example-ast-dump, then you need to take theclang -cc1line generated by the driver and add the option you need. Alternatively, you can runclang -Xclangto force the driver passtoclang -cc1.
The emphasis is mine. This should give you enough guidance to get what you need done.