Posted on Sep 11, 2019
I usually try to use the latest release of the gnu Compiler Collection (gcc); I do not have a true need for this, but I just want it. I end up having multiple gcc versions installed under the /opt directory of my Slackware system. The last release is currently version ‘9.1.0’.
I have no problems when compiling C language source files, but when compiling C++ language sources I get errors like these (in this specific case: Libexpat’s test suite):
libtool: link: g++ -g -O2 -Wall -Wextra -fexceptions -fno-strict-aliasing -fno-strict-aliasing -o .libs/runtestspp runtestspp.o libruntests.a ../lib/.libs/libexpat.so -Wl,-rpath -Wl,/usr/local/lib /opt/gcc/9.1.0/lib64/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../lib64/libstdc++.so: undefined reference to `libiconv' /opt/gcc/9.1.0/lib64/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../lib64/libstdc++.so: undefined reference to `libiconv_close' /opt/gcc/9.1.0/lib64/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../lib64/libstdc++.so: undefined reference to `libiconv_open' collect2: error: ld returned 1 exit status