Why doesn't Clang come with standard library headers?

10,263

Solution 1

The standard library is NOT part of the compiler itself. It is part of the runtime environment on a particular platform. Sure, some organisations put together a "kit" with all the necessary parts to build an application - there may even be someone that packages a Clang compiler with a suitable runtime.

In general, you should be able to download the Windows SDK and get the relevant header files there - and if you use clang-cl, it should be largely compatible with the MSVC compiler [or provide clang or clang++ with the correct -fms-compatibility or whatever it is called].

Or as suggested in the other answer, use libcxx, but it's not 100% complete for Windows.

Solution 2

They do have a c++ standard library: libcxx.llvm.org. But it's not fully supported on the windows platform.

Share:
10,263

Related videos on Youtube

Therhang
Author by

Therhang

Updated on June 04, 2022

Comments

  • Therhang
    Therhang almost 2 years

    I downloaded Clang 3.6.2 from this website and am trying to set it up with Code::Blocks under Windows. Unfortunately, it fails to compile a simple "hello world" program on the grounds that it doesn't know where iostream is.

    Looking through the install folder, it does not appear to include a standard library with it. Why? And how do I get it?

  • Therhang
    Therhang almost 9 years
    Not fully supported? Can you elaborate?
  • chris
    chris almost 9 years
    @Therhang, Last I heard, the exception situation (IIRC, the Structured Exception Handling side) was a difficult problem.
  • Bill Lynch
    Bill Lynch almost 9 years
    @Therhang: On their website, they have a list of supported platforms. It doesn't include Windows. But they do say: "Ports to other platforms are underway. Here are recent test results for Windows and Linux."