5

./a.out: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory

even though:

$ echo $LD_LIBRARY_PATH
/home/exe/libcxx/lib:/home/exe/llvm/lib:/usr/local/lib
$ ls /usr/local/lib
libc++.so  libc++.so.1  libc++.so.1.0  python2.7  python3.2

I even copied it next to the executable, still no effect.

What am I doing wrong?

2 Answers2

8

You might need to run sudo ldconfig /usr/local/lib to update the dynamic linker cache. Otherwise I think the system doesn't know which libraries are available from that directory. See man ldconfig for more info.

Paul
  • 7,194
0

The correct answer turns out to be that you should do export LD_LIBRARY_PATH = .. See https://stackoverflow.com/questions/1158091/defining-a-variable-with-or-without-export

Rick
  • 180
  • 11