I try to build simple hello world completely without gcc/g++ instalation just to use latest clang++-21.1.3.
hello.cxx:
#include <iostream>
int main(int argc, char** argv)
{
std::cout << "hello world" << std::endl;
return std::cout.fail();
}
Command to build:
clang++ -std=c++20 -Wfatal-errors -stdlib=libc++ \
-isystem /home/leo/LLVM-21.1.3-Linux-X64/include/c++/v1 \
-isystem /home/leo/LLVM-21.1.3-Linux-X64/include/x86_64-unknown-linux-gnu/c++/v1 \
hello.cxx
Output:
In file included from hello.cxx:1:
In file included from /home/leo/LLVM-21.1.3-Linux-X64/include/c++/v1/iostream:45:
In file included from /home/leo/LLVM-21.1.3-Linux-X64/include/c++/v1/ios:222:
In file included from /home/leo/LLVM-21.1.3-Linux-X64/include/c++/v1/iosfwd:120:
In file included from /home/leo/LLVM-21.1.3-Linux-X64/include/c++/v1/__std_mbstate_t.h:14:
/home/leo/LLVM-21.1.3-Linux-X64/include/c++/v1/__mbstate_t.h:51:4: fatal error: "We don't know how to get the
definition of mbstate_t on your platform."
51 | # error "We don't know how to get the definition of mbstate_t on your platform."
| ^
1 error generated.
I think it should be possible to build binary without instalation gcc toolchain just using llvm release