Fatal error: 'stdio.h' file not found

I have added the llvm path, but this error occurs.

clang --target=riscv64 -O -S -o- foo.c -march=rv64imaczba_zbb >andn-assembly13.txt
foo.c:1:9: fatal error: ‘stdio.h’ file not found
1 error generated.

clang should find the missing file, but …

clang -print-resource-dir

There should be an include directory in there. It “should” contain the stdio.h file.
Maybe you have to add something like:

-I`clang -print-resource-dir`/include
1 Like

Clang doesn’t provide a stdio.h, it should come from your C standard library implementation, whatever that is

1 Like

Sorry. I misread the name of the missing file.

1 Like

Thank you so much.

I could not find include directory.What should I do for that?

Hi!, newbie here also studying.
maybe try with show verbose log with “-v” or “–verbose” and see how the include paths are.

clang --verbose --target=riscv64 -O -S -o- foo.c -march=rv64imaczba_zbb >andn-assembly13.txt
1 Like

I could solve that issue by correcting the path of riscv gcc toolchain.

Is there a way to instruct Clang to use the MSYS2/Mingw-w64 GCC compiler installed in C:\tools\msys64\mingw64\bin\gcc.exe? I want to solve my other problem here.