0

I'm working on a shared CentOS server where I don't have root.

cat /etc/centos-release
CentOS Linux release 7.8.2003 (Core)

I recently updated my GCC/G++ version to 9.4.0, but now all of my C++ builds are failing at the linking step. I've tracked down the issue to the fact that ld is looking for libraries in directories that I haven't told it to and picking up old versions of libstdc++ that I can't get rid of. Moreover, it seems to be completely unresponsive to both LD_LIBRARY_PATH and LIBRARY_PATH.

-bash-4.2$ export LD_LIBRARY_PATH=/public/users/jeizenga/.local/lib:/public/users/jeizenga/.local/lib64
-bash-4.2$ export LIBRARY_PATH=/public/users/jeizenga/.local/lib:/public/users/jeizenga/.local/lib64
-bash-4.2$ ld --verbose | grep SEARCH_DIR | tr -s ' ;' '\n'
SEARCH_DIR("/usr/local/lib64")
SEARCH_DIR("/lib64")
SEARCH_DIR("/usr/lib64")=
SEARCH_DIR("/usr/local/lib")
SEARCH_DIR("/lib")
SEARCH_DIR("/usr/lib")

What am I missing here? Everything I've found so far has suggested using these environment variables to solve the problem, but that's not working for me.

Jordan
  • 1
  • 1
  • Add the output of `echo $LIBRARY_PATH` and `echo $LD_LIBRARY_PATH` to the question. – Nasir Riley Jan 22 '22 at 21:53
  • check ld.so.conf and ld.so.conf.d – stark Jan 23 '22 at 13:25
  • @NasirRiley the `echo`s give what you'd expect from the `export` statement. @stark from the contents of `ls.so.conf` are `include ld.so.conf.d/*.conf` and `ls /etc/ld.so.conf.d/` gives a bunch of `.conf` files. I'm not quite sure how to interpret these though. – Jordan Jan 23 '22 at 22:01

0 Answers0