I am using Ubuntu 22.04.3 LTS in WSL. I successfully built and installed GCC 13.2.0 from source. This is how I configured it:
../gcc/configure --host=x86_64-pc-linux-gnu --disable-multilib --enable-languages=c,c++
g++ was then successfully installed in /usr/local/bin/g++
after all the right steps. But when I tried to run a simple Hello World application, I got the following runtime error:
./hello: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by ./hello)
It seems that the program is not being linked with the latest built libstdc++, or maybe it wasn't properly built at all. How can I fix this error? Thank you.
I also encountered the same issue, and this is how I solved it:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install --only-upgrade libstdc++6
It seems like the /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' is for gcc13, so we need to update this file.
check the result:
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
output:
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_3.4.29
GLIBCXX_3.4.30
GLIBCXX_3.4.31
GLIBCXX_3.4.32
GLIBCXX_TUNABLES
GLIBCXX_DEBUG_MESSAGE_LENGTH
Try the following:
conda install -c conda-forge libstdcxx-ng
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With