[cfe-dev] C++11 freestanding headers not found

Modulo De Pi via cfe-dev cfe-dev at lists.llvm.org
Mon Jun 12 13:54:49 PDT 2017


Hello everyone,

I've recently discovered the LLVM project and Clang, and I am quite happy
with it (nice piece of work!). However, I can't figure why this fails:

$ cat > freestanding.cpp
#include <cstdint>
$ clang -c -std=c++11 -ffreestanding --target=i386-none-elf freestanding.cpp
bug.cpp:1:10: fatal error: 'cstdint' file not found
#include <cstdint>
         ^
1 error generated.
$

Trying to compile a source file that merely includes a C++11 header file
with the -ffreestanding flag just fails. The same problem occurs for every
C++11 freestanding header (<cstdint>, <cstddef>, <climits>...). However,
trying to include the pre-C++11 freestanding headers (<stdint.h>,
<stddef.h>, <limits.h>, ...) works just fine. I have also tried different
targets.

Any idea? Is this some configuration issue? Or some glitch? I can hardly
find any information about this problem, this is why I am asking you people.

Have a nice day,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170612/7dc1b922/attachment.html>


More information about the cfe-dev mailing list