What are libstdc++.so.6 and GLIBCXX_3.4.20

GNU Compiler Collection or GCC is a free and open-source compiler system. It was developed by the GNU Project, which supports a wide range of programming languages, including C, C++, Objective-C, and many others. The libstdc++.so.6 is a shared library, a collection of classes, functions, and algorithms to simplify the development of C++ applications. The GLIBCXX_3.4.20 is a version symbol used in the C++ standard library, which is libstdc++.so.6.

This guide explains the libstdc++.so.6 and GLIBCXX_3.4.20.

  • GCC
  • Install GCC on Linux
  • Libstdc++.so.6
  • Install Libstdc++ .so.6
  • GLIBCXX_3.4.20

What is GCC?

The GNU Compiler Collection (GCC) is an open-source compiler system created by the GNU Project. It supports a wide range of programming languages, including C, C++, Objective-C, and others. It is typically used to convert source code into executable code. GCC includes several tools for compiling, linking, debugging, and optimizing software. It is widely used in the software development industry to create programs, libraries, and operating systems.

How to Install GCC on Linux?

The GCC comes in the build-essential package, which can be installed using these commands:

$ sudo apt install build-essential #Ubuntu/Debian
$ sudo dnf install build-essential       #Fedora
$ sudo yum install build-essential       #CentOS

The above command shows the installation of GCC on Ubuntu 22.04 LTS.

What is Libstdc++.so.6?

Libstdc++.so.6 is a critical shared library that implements the GLIBCXX_3.4.20 and other versions. It is used by many compilers and applications built using C++. It contains commonly used functions, classes, and algorithms for containers, iterators, and algorithms. This library is portable and compatible with various systems and platforms.

How to Install Libstdc++.so.6 on Linux?

The “libstdc++6” is included in the official repositories of all distributions of Linux and is installed using these commands:

$ sudo apt install libstdc++6 #Ubuntu/Debian
$ sudo yum install libstdc++.so.6 #CentOS
$ sudo dnf install libstdc++ #Fedora

The above figure shows the installation of “libstdc++6” on Ubuntu 22.04 LTS and here is a detailed guide on it.

What is GLIBCXX_3.4.20?

GLIBCXX_3.4.20 is a version of the C++ Standard Library included in the GNU C Library (glibc) that provides new features and enhancements over earlier versions. It was released with GCC 4.8 and features improvements such as move semantics support, range-based for loops, and variadic templates.

Applications and programs are written with GCC 4.8 or later that utilize functionality available exclusively in GLIBCXX_3.4.20 or later will require this library version to be present at runtime. To execute the program correctly, the system must have a compatible version of the libstdc++.so.6 shared libraries containing GLIBCXX_3.4.20.

Note: Since it is a library, there is no need to install it as it comes with libstdc++.so.6 whose installation is mentioned above.

Conclusion

GCC is a popular open-source compiler system widely used in software development to create programs, libraries, and operating systems. Libstdc++.so.6 is a crucial shared library used by many compilers and C++ applications, containing functions, and algorithms. GLIBCXX_3.4.20 is a version of the C++ Standard Library that is required for programs utilizing its exclusive functionality. Therefore, these tools play a vital role in the development and execution of C++ programs, making them essential components of the software development process.

This guide has explained the libstdc++.so.6 and GLIBCXX_3.4.20.