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:
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:
output: