GLIBCXX_3.4.32′ not found error at runtime. GCC 13.2.0

This error means your system’s libstdc++.so.6 is older than the one your GCC 13.2.0 program was built against. The binary requires symbol version GLIBCXX_3.4.32, but your OS (Ubuntu 22.04, Debian 12, etc.) only provides up to 3.4.30 or 3.4.31. The fix is upgrading libstdc++6 or using the new libstdc++ at runtime—never replace system libraries manually.


Understanding the Problem

What Does the Error Mean?

./hello: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by ./hello)

Symbol versioning in libstdc++.so.6 tags each C++ standard library function with a version. GCC 13.2.0’s libstdc++ includes new symbols (e.g., for std::format, std::chrono improvements) marked GLIBCXX_3.4.32. Your system’s default libstdc++ doesn’t have them.

Check Your System’s GLIBCXX Versions

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.3

Typical output on Ubuntu 22.04:

GLIBCXX_3.4
GLIBCXX_3.4.1
...
GLIBCXX_3.4.30      # <-- Latest available

Missing: GLIBCXX_3.4.31, GLIBCXX_3.4.32


Fix 1: Upgrade libstdc++6 via PPA (Ubuntu/Debian)

Recommended for Ubuntu 22.04, 20.04, Debian 12, 11.

Add the Ubuntu Toolchain PPA, which provides newer libstdc++:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install --only-upgrade libstdc++6

Verify:

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.32
# Should now show GLIBCXX_3.4.32

Why it works: The PPA ships libstdc++ from GCC 13.3.0 (or newer), which includes the required symbols. Your old system libc remains untouched.


Fix 2: Use Your GCC’s Built-in libstdc++ at Runtime

For users who built GCC 13.2.0 from source.

When you built GCC, it compiled a new libstdc++ (usually in /usr/local/lib64/). You must tell the dynamic linker to use it.

Option A: Set LD_LIBRARY_PATH (Quick & Temporary)

export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH
./hello

Caveat: This affects all programs in your shell. Can break system apps that expect the older libstdc++.

Option B: Use rpath (Permanent for Your Binary)

Compile with the new libstdc++ baked in:

/usr/local/bin/g++ -Wl,-rpath,/usr/local/lib64 hello.cpp -o hello
./hello  # Now works without LD_LIBRARY_PATH

Option C: Use the Interpreter Directly (Pro Move)

/usr/local/lib64/ld-linux-x86-64.so.2 \
  --library-path /usr/local/lib64:/lib/x86_64-linux-gnu \
  ./hello

This short-circuits the binary’s bootstrap, forcing it to use the new libraries without modifying system state.


Fix 3: Build libstdc++ to a Custom Prefix (Advanced)

If you installed GCC 13.2.0 to /usr/local but libstdc++ is missing.

Your GCC build should have produced libstdc++.so.6.0.32 in /usr/local/lib64/. If not, rebuild GCC with:

./configure --prefix=/usr/local --enable-languages=c,c++ \
            --disable-multilib --with-system-zlib
make -j$(nproc)
sudo make install

If the library exists but isn’t found:

sudo cp /usr/local/lib64/libstdc++.so.6.0.32 /usr/lib/x86_64-linux-gnu/
sudo ldconfig

⚠️ Warning: Overwriting system libstdc++ can break apt, sudo, and your desktop. Use Fix 1 instead.


Fix 4: Docker Container (Zero Risk)

Best for CI/CD and isolated builds.

Run your app inside a container with matching GCC/libstdc++:

# Ubuntu 23.10+ has GCC 13 by default
docker run -it -v $PWD:/work ubuntu:23.10 bash
# Inside container:
apt update && apt install -y g++
g++ hello.cpp -o hello
./hello  # Works perfectly

Or use a pre-built GCC 13 image:

docker run -it --rm gcc:13.2 bash

Fix 5: Rebuild Your Binary on the Oldest System You Support

Best practice for distribution.

If you target Ubuntu 22.04, build on Ubuntu 22.04. The binary will link against GLIBCXX_3.4.30 and run everywhere 22.04+.

GitHub Actions example:

jobs:
  build:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
      - run: g++ hello.cpp -o hello
      - uses: actions/upload-artifact@v4
        with:
          path: hello

Troubleshooting FAQ

Q1: I upgraded libstdc++6 but still get the error?

A: Check if another libstdc++ overrides it:

ldd ./hello | grep libstdc++
# If it shows /home/conda/lib/libstdc++.so.6, conda is hijacking your library path.

Fix: unset LD_LIBRARY_PATH or conda deactivate.

sudo ln -sf /usr/local/lib64/libstdc++.so.6.0.32 /usr/lib/x86_64-linux-gnu/libstdc++.so.6

NO. This breaks programs expecting the old version. Use the PPA or rpath.

Q3: Why does this happen with GCC 13.2.0 but not GCC 12?

A: GCC 13 introduced new C++23 features requiring GLIBCXX_3.4.32. GCC 12 only goes up to 3.4.30.


Bottom Line

ScenarioBest Fix
Ubuntu/Debian userFix 1 (PPA upgrade)
Built GCC from sourceFix 2 (use rpath or LD_LIBRARY_PATH)
CI/CD or isolated envFix 4 (Docker)
Distributing to usersFix 5 (build on oldest target OS)
System is already brokenReinstall libstdc++6 from live USB

The error looks scary, but it’s just a version mismatch. Update libstdc++ or point your binary to the right library, and you’re done. Don’t overthink it.