I try to build an application with clang++-17 and a self built libc++ for x64 linux. However, the final link of the app fails
/usr/bin/ld: ~/workspace/usr/lib64/somearchive.a(somearchive.cpp.o): undefined reference to symbol ‘_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEPKc@@GLIBCXX_3.4.21’
/usr/bin/ld: /lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
clang++-17: error: linker command failed with exit code 1 (use -v to see invocation)
In theory, the libstdc++ should provide these symbols:
user@user-Precision-7510:~/Desktop$ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.21
GLIBCXX_3.4.21
user@user-Precision-7510:~/Desktop$ strings /lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.21
GLIBCXX_3.4.21
user@user-Precision-7510:~/Desktop$
Unfortunately, I cannot prevent some of the external libs to link against libstdc++.
Adding -lstdc++ to the final clang++ call doesn’t help.
Any ideas? Regards.