Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

even though:

$ 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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
"You can accept an answer in 4 minutes" :) –  nlognfan Jun 1 '13 at 16:53
It works. Do I have to repeat it after every reboot? –  nlognfan Jun 1 '13 at 16:55
No, it should update /etc/ld.so.cache permanently. You should only need to re-run if you add or remove libraries in that directory again (normally apt-get handles this step for you for packaged libraries under /usr). –  Paul Jun 1 '13 at 16:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.