How to configure libstdc++ with GCC 4.8?

后端 未结 1 1015
有刺的猬
有刺的猬 2021-01-04 19:50

A while back, I decided to upgrade to GCC 4.8 in order to get an early start on some c++11 features. I got a bit sidetracked, though, and didn\'t really put any of the new f

相关标签:
1条回答
  • 2021-01-04 20:18

    You need to tell your dynamic linker (it's executed when you run your program) where to find the library. Set LD_LIBRARY_PATH to the path of the library (probably somewhere under /app/gcc/4.8.0/lib or something).

    Use find /app/gcc/4.8.0 -name "libstdc++.so.6". Add the directory to your LD_LIBRARY_PATH. e.g with the path I mentioned:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/gcc/4.8.0/lib (if you're using a bourne-like shell which the default on Linux).

    Then try to run your program.

    If it works, you'll probably want to configure your dynamic linker to look in the directory without using LD_LIBRARY_PATH. See man ld.so for details about how to configure the path.

    0 讨论(0)
提交回复
热议问题