In the past, my ignorance has led me to messing around with gcc/g++ version. As of current, I'm using Ubuntu 18.04 and running gcc --version
gave me this:
gcc (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
However, after some debugging, I realised that my libstdc++.so.6 is linking against the wrong version. I knew about this by running ls -l /usr/lib/x86_64-linux-gnu/libstdc++.so.6
, which gave me:
lrwxrwxrwx 1 root root 19 May 19 2020 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 -> libstdc++.so.6.0.28
Checking against the ABI, apparently it came from gcc 9.3.0, which I do remember installing at one point. This has caused me some weird bugs when programming C++.
Now, I would like to link libstdc++.so.6 back to gcc 8 but I'm not sure what's the less idiotic way to do this. Should I try removing GCC 9 and reinstall GCC 8?
Running locate libstdc++.so.6
gave me this:
/opt/nvidia/nsight-systems/2020.3.2/host-linux-x64/libstdc++.so.6
/opt/nvidia/nsight-systems/2020.3.2/target-linux-armv8/host-linux-armv8/libstdc++.so.6
/snap/core18/1988/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core18/1988/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
/snap/core18/1988/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25-gdb.py
/snap/core18/2066/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core18/2066/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
/snap/core18/2066/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25-gdb.py
/usr/lib/i386-linux-gnu/libstdc++.so.6
/usr/lib/i386-linux-gnu/libstdc++.so.6.0.28
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28
/usr/share/gdb/auto-load/usr/lib/i386-linux-gnu/libstdc++.so.6.0.28-gdb.py
/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28-gdb.py