[LLVMdev] Basic commands of llvm : fatal error

Dmitri Gribenko gribozavr at gmail.com
Sun Jan 6 04:58:31 PST 2013


On Sun, Jan 6, 2013 at 7:26 AM, Akash Gulhane <gulhane.akash at gmail.com> wrote:
> I just started using llvm and trying to use some basic commands of llvm,
> when i tried to execute clang -cc1 ~/hello.c -ast-print, i'm getting the
> error :
>
> 'fatal error: 'stdio.h' file not found'
>
> #include<stdio.h>
>               ^
> int main()
> {
>     printf("hi\n");
>     return 0;
> }
>
> 1 error generated.
>
> so please help me out. Thanks!

'clang -cc1' is the frontend, 'clang' is the driver.  The driver
invokes the frontend with appropriate options.  See:

clang -### -c hello.c

So either copy those options to your 'clang -cc1' line, or use 'clang
-Xclang -ast-dump hello.c' to force the driver pass '-ast-dump'
option.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the llvm-dev mailing list