How to enable libc++ support for llvm?
Issue
llvm-toolset-12.0
missinglibc++
- When using the
llvm-toolset-12.0
to compile C++ code with theclang++ -stdlib=libc++
flag, standard library header files are not found.
$ clang++ -stdlib=libc++ hello-world.cpp
hello-world.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
^~~~~~~~~~
1 error generated.
Environment
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 7
- LLVM Toolset compiling with Clang
libc++
standard library instead of GCC G++libstdc++
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.