Having compiled a new version of gcc I've also compiled standard c++ library that came with it.
I specify to cmake using new compiler by exporting CC and CXX variables like export CXX=/path/to/gcc-13.2/bin/g++
But instead linking fresh-compiler's STL, cmake links system-wide STL.
I have tried to set
-DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib64/libstdc++.so.6 -DCMAKE_SYSTEM_LIBRARY_PATH=/path/to/gcc-13.2/lib -DCMAKE_SYSTEM_INCLUDE_PATH=/path/to/gcc-13.2/include
But it does not work, ldd executable shows:
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f50f5d3f000)
and in runtime I get:
/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by ....)
How do I specify to cmake to use new compiler's includes and libs?