Skip to content

Can't build hello world without gcc instalation on linux got: We don't know how to get the definition of mbstate_t on yourΒ #164070

@leanid

Description

@leanid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions