Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6725

Setup libstdc++ for a given gcc version

$
0
0

New to Linux here.Already had gcc 11 and 12 on my ubuntu but compiled gcc-14 using following command:

./configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-14.1.0 --enable-checking=release --enable-languages=c,c++ --disable-multilib --program-suffix=-14.1.0

then after make && make install

I added gcc-14 to my list of available compilers using update-alternatives:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/local/gcc-14.1.0/bin/gcc-14.1.0 14 --slave /usr/bin/g++ g++ /usr/local/gcc-14.1.0/bin/g++-14.1.0  --slave /usr/bin/gcov gcov /usr/local/gcc-14.1.0/bin/gcov-14.1.0

However when compiling cpp code that use c++23 features I get link error:

/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.31' not found

I guess the libstdc++.so here is the one used for gcc-12 or gcc-11. libstdc++.so is available for gcc-14 at /usr/local/gcc-14.1.0/lib64/libstdc++.so

Is there a way to specify that gcc-14 should always use is own libstdc++ ? (Without specifying static path to the libstdc++ to use at compile time inside my cmake script)


Viewing all articles
Browse latest Browse all 6725

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>