[LLVMdev] clang.exe: fatal error: 'stdio.h' file not found

2,952 views
Skip to first unread message

Andrew Pennebaker

unread,
Nov 19, 2013, 7:49:41 PM11/19/13
to LLVM Dev
I'm trying to compile hello.c with clang.exe, but I'm getting an error about missing cstdlib headers.

Source:


Trace:

C:\Users\andrew\Desktop\src\mcandre\c\hello>gmake
clang -O2 -Wall -Wextra -Wmost -Weverything -o hello hello.c
hello.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^
1 error generated.
gmake: *** [hello] Error 1

Do I need to add libs to the compile command, something like -lc? I tried a few variants, like -lc, -lstdlib, -lcstdlib, with no success.

System:

* clang.exe version 3.4 (trunk), from LLVM 3.4.svn
* gmake 3.82, from StrawberryPerl 5.16.3.3
* Windows 8.1 Professional x64

--
Cheers,

Andrew Pennebaker

NAKAMURA Takumi

unread,
Nov 19, 2013, 8:06:53 PM11/19/13
to Andrew Pennebaker, LLVM Dev
Andrew,

This might be offtopic for llvmdev. I suggest the mailing list, cfe-users.

> * clang.exe version 3.4 (trunk), from LLVM 3.4.svn

How did you build it? clang.exe depends on crt libraries, either
mingw32 or msvcrt.

Please try (and watch their output);

> clang --version
> clang -v -O2 -o hello.exe hello.c

Please confirm;

- Which library did you install? Visual studio or mingw?
- Where is its path?

...Takumi
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Andrew Pennebaker

unread,
Nov 20, 2013, 11:40:04 AM11/20/13
to NAKAMURA Takumi, LLVM Dev
This might be offtopic for llvmdev. I suggest the mailing list, cfe-users.

Thanks for the direction! I'll ping them as well.

How did you build it? clang.exe depends on crt libraries, either
mingw32 or msvcrt.

I didn't build it. I installed clang with the snapshot installer for Windows: http://llvm.org/builds/

Please try (and watch their output);

> clang --version
> clang -v -O2 -o hello.exe hello.c

I'm using clang version 3.4 (trunk), from LLVM 3.4.svn.

I'm away from my Windows computer for now, but I'll try to get the full outputs later.
 
Please confirm;

  - Which library did you install? Visual studio or mingw?
  - Where is its path?

As I did not build clang myself, but used the snapshot installer, I don't know for sure.

I can tell you that I do not currently have any Visual Studio product installed.

I do have a form of cygwin installed (Git Bash for Windows), and also StrawberryPerl. Either of these could include some C libs, though I doubt clang.exe was built to integrate with them in mind.

Reply all
Reply to author
Forward
0 new messages