To find which library is being used you could run

Copy $ /sbin/ldconfig -p | grep stdc++
    libstdc++.so.6 (libc6) => /usr/lib/libstdc++.so.6

The list of compatible versions for libstdc++ version 3.4.0 and above is provided by

Copy $ strings /usr/lib/libstdc++.so.6 | grep LIBCXX
 GLIBCXX_3.4
 GLIBCXX_3.4.1
 GLIBCXX_3.4.2
 ...

For earlier versions the symbol GLIBCPP is defined.

The date stamp of the library is defined in a macro __GLIBCXX__ or __GLIBCPP__ depending on the version:

Copy// libdatestamp.cxx
#include <cstdio>

int main(int argc, char* argv[]){
#ifdef __GLIBCPP__
    std::printf("GLIBCPP: %d\n",__GLIBCPP__);
#endif
#ifdef __GLIBCXX__
    std::printf("GLIBCXX: %d\n",__GLIBCXX__);
#endif
   return 0;
}

$ g++ libdatestamp.cxx -o libdatestamp
$ ./libdatestamp
GLIBCXX: 20101208

The table of datestamps of libstdc++ versions is listed in the documentation:

Answer from Dima Chubarov on Stack Overflow
🌐
GNU
gcc.gnu.org › onlinedocs › libstdc++
The GNU C++ Library
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. This is the top level of the libstdc++ documentation set.
🌐
GitHub
github.com › gcc-mirror › gcc › blob › master › libstdc++-v3 › include › precompiled › stdc++.h
gcc/libstdc++-v3/include/precompiled/stdc++.h at master · gcc-mirror/gcc
// Under Section 7 of GPL version 3, you are granted additional · // permissions described in the GCC Runtime Library Exception, version · // 3.1, as published by the Free Software Foundation. · // You should have received a copy of the GNU General Public License and ·
Author   gcc-mirror
Discussions

c++ - How do you find what version of libstdc++ library is installed on your linux machine? - Stack Overflow
The table of datestamps of libstdc++ versions is listed in the documentation: ... Sign up to request clarification or add additional context in comments. ... The datestamps are almost entirely useless, I don't know why we bother keeping them or documenting them. For example, the date for GCC 4.6.3 ... More on stackoverflow.com
🌐 stackoverflow.com
How can I know the libstdc++ version shipped with each gcc version? - Stack Overflow
I need to check the libstdc++ used with some old versions like gcc 4.3.2 and 4.3.4. I tired downloading the source code from ftp.gwdg.de/pub/misc/gcc/snapshots but couldn't find a directory named libstdc++ 2012-06-24T10:06:45.983Z+00:00 More on stackoverflow.com
🌐 stackoverflow.com
libstdc++ vs libstdc++11 when using gcc version 8+ and -std=c++17

What is libstdc++11?

More on reddit.com
🌐 r/cpp
21
14
July 14, 2020
gcc - What is libstdc++.so.6 and GLIBCXX_3.4.20? - Unix & Linux Stack Exchange
I am looking for some simple answers in order to understand some of these concepts. I am trying to install a R library which is failing with the error: /lib64/libstdc++.so.6: version ``GLIBCXX_3.4... More on unix.stackexchange.com
🌐 unix.stackexchange.com
🌐
GNU
gcc.gnu.org › onlinedocs › libstdc++ › faq.html
Frequently Asked Questions
4.1. Can libstdc++ be used with non-GNU compilers? 4.2. No 'long long' type on Solaris? 4.3. _XOPEN_SOURCE and _GNU_SOURCE are always defined? 4.4. Mac OS X ctype.h is broken! How can I fix it? 4.5. Threading is broken on i386? 4.6. MIPS atomic operations · 4.7. Recent GNU/Linux glibc required? 4.8. Can't use wchar_t/wstring on FreeBSD · 5.1. What works already? 5.2. Bugs in the ISO C++ language or library specification · 5.3. Bugs in the compiler (gcc/g++) and not libstdc++ 6.1.
🌐
Debian
packages.debian.org › sid › libstdc++6
Debian -- Details of package libstdc++6 in sid
The first version of libstdc++-v3 appeared in g++-3.0. Tags: Role: Shared Library · dep: gcc-14-base (= 14-20240221-2.1) [ia64] GCC, the GNU Compiler Collection (base package) dep: gcc-16-base (= 16.1.0-1) [not ia64] GCC, the GNU Compiler Collection (base package) dep: libc6 (>= 2.38) [not alpha, i386, ia64, loong64, sh4] GNU C Library: Shared libraries also a virtual package provided by libc6-udeb ·
🌐
MIT
web.mit.edu › darwin › src › modules › gcc3 › libstdc++-v3 › docs › html › install.html
libstdc++-v3 Installation Instructions
Check out or download the GCC sources: the resulting source directory (gcc or gcc-3.0.3, for example) is gccsrcdir. Once in gccsrcdir, you'll need to rename or delete the libstdc++-v3 directory which comes with that snapshot: mv libstdc++-v3 libstdc++-v3-previous [OR] rm -r libstdc++-v3 · ...
🌐
GitHub
github.com › gcc-mirror › gcc › tree › master › libstdc++-v3
gcc/libstdc++-v3 at master · gcc-mirror/gcc
April 2, 2020 - file: libstdc++-v3/README New users may wish to point their web browsers to the file index.html in the 'doc/html' subdirectory.
Author   gcc-mirror
Top answer
1 of 4
124

To find which library is being used you could run

Copy $ /sbin/ldconfig -p | grep stdc++
    libstdc++.so.6 (libc6) => /usr/lib/libstdc++.so.6

The list of compatible versions for libstdc++ version 3.4.0 and above is provided by

Copy $ strings /usr/lib/libstdc++.so.6 | grep LIBCXX
 GLIBCXX_3.4
 GLIBCXX_3.4.1
 GLIBCXX_3.4.2
 ...

For earlier versions the symbol GLIBCPP is defined.

The date stamp of the library is defined in a macro __GLIBCXX__ or __GLIBCPP__ depending on the version:

Copy// libdatestamp.cxx
#include <cstdio>

int main(int argc, char* argv[]){
#ifdef __GLIBCPP__
    std::printf("GLIBCPP: %d\n",__GLIBCPP__);
#endif
#ifdef __GLIBCXX__
    std::printf("GLIBCXX: %d\n",__GLIBCXX__);
#endif
   return 0;
}

$ g++ libdatestamp.cxx -o libdatestamp
$ ./libdatestamp
GLIBCXX: 20101208

The table of datestamps of libstdc++ versions is listed in the documentation:

2 of 4
22

What exactly do you want to know?

The shared library soname? That's part of the filename, libstdc++.so.6, or shown by readelf -d /usr/lib64/libstdc++.so.6 | grep soname.

The minor revision number? You should be able to get that by simply checking what the symlink points to:

Copy$ ls -l  /usr/lib/libstdc++.so.6
lrwxrwxrwx. 1 root root 19 Mar 23 09:43 /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.16

That tells you it's 6.0.16, which is the 16th revision of the libstdc++.so.6 version, which corresponds to the GLIBCXX_3.4.16 symbol versions.

Or do you mean the release it comes from? It's part of GCC so it's the same version as GCC, so unless you've screwed up your system by installing unmatched versions of g++ and libstdc++.so you can get that from:

Copy$ g++ -dumpversion
4.6.3

Or, on most distros, you can just ask the package manager. On my Fedora host that's

Copy$ rpm -q libstdc++
libstdc++-4.6.3-2.fc16.x86_64
libstdc++-4.6.3-2.fc16.i686

As other answers have said, you can map releases to library versions by checking the ABI docs

Find elsewhere
🌐
Linux From Scratch
linuxfromscratch.org › lfs › view › development › chapter05 › gcc-libstdc++.html
5.6. Libstdc++ from GCC-16.1.0
You should first unpack the GCC tarball and change to the gcc-16.1.0 directory. Create a separate build directory for Libstdc++ and enter it:
🌐
Reddit
reddit.com › r/cpp › libstdc++ vs libstdc++11 when using gcc version 8+ and -std=c++17
r/cpp on Reddit: libstdc++ vs libstdc++11 when using gcc version 8+ and -std=c++17
July 14, 2020 -

Is there a difference between libstdc++ and libstdc++11 in the current releases of gcc (or at least gcc >=8)?

I want to create libraries that support code using the C++17 standard.

I can't find any concise answer on which lib to use or if it even matters.

🌐
GitHub
gist.github.com › ernstki › 593076d2d164ca51d4a6c0a15731846f
List the ABI versions of all detected libc and libstdc++'s (GNU/Linux only) · GitHub
The libcversions.sh included as a part of this gist reports which libc and libstdc++ ABI versions are available to running programs. It does this by inspecting the output of ldconfig as well as the value of LD_LIBRARY_PATH, which is usually modified by modulefiles (e.g., when you module load gcc/4.8.5).
🌐
Debian
packages.debian.org › sid › libstdc++-13-dev
Debian -- Details of package libstdc++-13-dev in sid
The first version of libstdc++-v3 appeared in g++-3.0. dep: gcc-13-base (= 13.2.0-23) [ia64] GCC, the GNU Compiler Collection (base package) dep: gcc-13-base (= 13.4.0-10) [not alpha, ia64, loong64, sh4] dep: gcc-13-base (= 13.4.0-4) [loong64] dep: gcc-13-base (= 13.4.0-5) [alpha] dep: gcc-13-base (= 13.4.0-9) [sh4] dep: libc6 (>= 2.38) [not alpha, i386, ia64, loong64, sh4] GNU C Library: Shared libraries also a virtual package provided by libc6-udeb ·
🌐
GNU
gcc.gnu.org › onlinedocs › libstdc++ › manual › setup.html
Chapter 2. Setup
If GCC 3.1.0 or later on is being used on GNU/Linux, an attempt will be made to use "C" library functionality necessary for C++ named locale support, e.g. the newlocale and uselocale functions. For GCC 4.6.0 and later, this means that glibc 2.3 or later is required.
🌐
Red Hat
access.redhat.com › solutions › 6969351
Which version of libstdc++ is provided in RHEL? How do we get a later GLIBCXX or CXXABI? - Red Hat Customer Portal
August 1, 2025 - Which version of libstdc++ is available on RHEL releases? ... If we install later GCC I can't see any way to get the matching version of the libstdc++ library. The installed version appears only to be as suppiled by the base OS RPM package.
🌐
Ubuntu
packages.ubuntu.com › jammy › libstdc++6
Ubuntu – Details of package libstdc++6 in jammy
» Ubuntu » Packages » jammy (22.04LTS) » libs » libstdc++6 · [ jammy ] [ jammy-updates ] [ noble ] [ noble-updates ] [ plucky ] [ questing ] [ resolute ] [ Source: gcc-12 ] Bug Reports · Ubuntu Changelog · Copyright File · Download Source Package gcc-12: [gcc-12_12.3.0-1ubuntu1~22.04.3.dsc] [gcc-12_12.3.0.orig.tar.gz] [gcc-12_12.3.0-1ubuntu1~22.04.3.debian.tar.xz] Ubuntu Developers (Mail Archive) Please consider filing a bug or asking a question via Launchpad before contacting the maintainer directly.
🌐
Medium
medium.com › @fixitblog › solved-setup-libstdc-for-a-given-gcc-version-25d0123be36f
Setup libstdc++ for a given gcc version | by Ted James | Medium
November 1, 2024 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/local/gcc-14.1.0/bin/gcc-14.1.0 14 --slave /usr/bin/g++ g++ /usr/local/gcc-14.1.0/bin/g++-14.1.0 --slave /usr/bin/gcov gcov /usr/local/gcc-14.1.0/bin/gcov-14.1.0 · However when compiling cpp code that use c++23 features I get link error: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.31' not found
🌐
Pale Moon Forum
forum.palemoon.org › viewtopic.php
Linux users: What version of glibc and libstdc++ is everyone on? - Pale Moon forum
December 23, 2023 - core/glibc 2.38-7 [installed] GNU ...linux-gnu-gcc 13.2.0-1 [installed] The GNU Compiler Collection - cross compiler for ARM64 target · Pale Moon and Epyrus on Arch Linux. ... Using andyprough's commands. ldd (Ubuntu GLIBC 2.35-0ubuntu3.5) 2.35 libstdc++6: Installed: 12.3.0-1ubuntu1~22.04 Merry Christmas! ... For Linux machines I am on various Debian versions, with newer ...
🌐
GitHub
github.com › gcc-mirror › gcc › blob › master › libstdc++-v3 › include › std › version
gcc/libstdc++-v3/include/std/version at master · gcc-mirror/gcc
// -*- C++ -*- Libstdc++ version details header. · // Copyright (C) 2018-2025 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free · // software; you can redistribute it and/or modify it under the · // terms of the GNU General Public License as published by the ·
Author   gcc-mirror