[cfe-dev] clang.exe: fatal error: 'stdio.h' file not found

Andrew Pennebaker andrew.pennebaker at gmail.com
Wed Nov 20 11:09:33 PST 2013


Ah, thanks. I'll `cinst mingw` when I get to my Windows machine, and try
compiling again.

Could we improve this error message? For missing stdlib headers, clang.exe
could say:

Standard libraries not found. Please install standard libraries from either
> Visual Studio or MinGW:
>
> http://www.visualstudio.com
> http://chocolatey.org/packages/mingw
>



On Wed, Nov 20, 2013 at 1:32 PM, Reid Kleckner <rnk at google.com> wrote:

> Clang doesn't ship with its own complete toolchain.  It always integrates
> with whatever standard C/C++ libs and headers the native platform uses.
>
> On Windows, there are two toolchains worth mentioning: the Visual C++
> toolchain, and the Mingw toolchain.
>
> If you want to build using make, etc, then you probably want to install
> mingw.  Then you can build with something like "clang
> --target=i686-pc-mingw32" and it should pick the right headers for you.
>
>
> On Wed, Nov 20, 2013 at 8:43 AM, Andrew Pennebaker <
> andrew.pennebaker at gmail.com> wrote:
>
>> I'm trying to compile hello.c with clang.exe, but I'm getting an error
>> about missing cstdlib headers.
>>
>> Source:
>>
>> https://github.com/mcandre/mcandre/tree/master/c/hello/
>>
>> 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, from the official
>> LLVM snapshot installer <http://llvm.org/builds/>
>> * gmake 3.82, from StrawberryPerl 5.16.3.3
>> * Windows 8.1 Professional x64
>>
>> --
>> Cheers,
>>
>> Andrew Pennebaker
>> www.yellosoft.us
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>


-- 
Cheers,

Andrew Pennebaker
www.yellosoft.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131120/2559fda5/attachment.html>


More information about the cfe-dev mailing list