https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64202
--- Comment #3 from Michael Truog <mjtruog at gmail dot com> --- The commands to compile the minimal example are: g++ -O0 -g -c test_lib.cpp -o test_lib.o g++ -fPIC -DPIC -shared test_lib.o -o libtest.so.0.0.0 gcc -O0 -g -c -o test_main.o test_main.c gcc -o test test_main.o libtest.so.0.0.0 -lstdc++ -Wl,-rpath -Wl,./