c++libstdc++libc++

What is libc++ and libstdc++


I have a few questions:

  1. What is libc++ and libstdc++?
  2. What is the difference between them?
  3. Are they interchangeable?
  4. Is it something a compiler should implement?
  5. When should I use one or another?

Solution

  • libstdc++ is the GNU c++ standard library implementation.

    libc++ is the LLVM/clang c++ standard library implementation.

    Even when compiling with clang, libstdc++ (gnu) is often used (on Linux).

    A main reason libc++ (clang) exists is that libstdc++ (gnu) is GPL and so Apple can't ship it, so you can think of libc++ as the non-GPL libstdc++.