1

all, I installed 'vowpal wabbit' package and also use 'make test' to test it. It shows everything is okay. However, when I input 'vw' in terminal, it has the following errors:

vw: error while loading shared libraries: libvw.so.0: cannot open shared object file: No such file or directory

My system is ubuntu12.04-64bit. Could anyone tell me how to solve this problem ? Thanks

4
  • Did you build this yourself, or get from a package? Can you rebuild the locate db with /etc/cron.daily/mlocate and then try locate libvw.so.0 Apr 11, 2013 at 20:55
  • I did it as you told me. I located the 'libvw.so.0'. "/home/tqjustc/Downloads/vowpal_wabbit-7.2/vowpalwabbit/.libs/libvw.so.0" and "/home/tqjustc/Downloads/vowpal_wabbit-7.2/vowpalwabbit/.libs/libvw.so.0.0.0" "/home/tqjustc/Downloads/vowpal_wabbit-7.2/vowpalwabbit/.libs/libvw.so.0.0.0" "/usr/local/lib/libvw.so.0" "/usr/local/lib/libvw.so.0.0.0" Apr 15, 2013 at 8:43
  • 3
    have you tried to set LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib and run it? Apr 15, 2013 at 17:44
  • @RichHomolka What is this command used for ? thanks Apr 15, 2013 at 17:53

2 Answers 2

5

From the messaging back and forth, it looks like you have the library installed in /usr/local/lib. But your application doesn't know to look there for the library.

You can solve this in a few ways.

  1. You can give special flags when you configure/build your project to tell your binary to check in /usr/local/lib. If you know how to set flags on build, you should set LDFLAGS=-Wl,-rpath,/usr/local/lib. This would make you rebuild though.

  2. The runtime linker looks at an environment variable named LD_LIBRARY_PATH to see what directories to check when looking for shared libraries. In this case, if you type export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib and then run your program, it should work.

  3. If you have multiple programs that need the /usr/local/lib directory, and you feel it is safe to include for everyone, you can set the runtime linker to try /usr/local/lib every time. You can drop a file in /etc/ld.so.conf.d or edit /etc/ld.so.conf to add /usr/local/lib. This would affect every executable on your system, so I consider this one pretty advanced.

In short, you need to tell your program how to find the library. The easiest one for now is to set the LD_LIBRARY_PATH variable with export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

0

Update: I was setting up "Quagga" from source code. After installation, when I ran it, I got the error "cannot open shared object file: No such file or directory". For my case, it was "libzebra.so.0" missing.

I used the "export" method as suggested by Rich in the above comment.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/foobar/lib

Where "/opt/foobar/lib" is your application specific shared library folder. For me, it was "/usr/local/lib/"

However, it didn't fix my issue. Then, to update the shared-library cache, I had to do a ldconfig to rebuild the shared-library cache. I found the suggestion from This Github post, You can also read details from how-to-add-library-directory-toldconfig-cache

2
  • 2
    While your link may provide a (partial?) answer, it is better if you post the information here,  and include the link for reference. Jul 27, 2017 at 2:18
  • Thanks for suggesting. I thought I should just include what additional command I had to use to make it work and give the reference of the main source. However, I'll update my comment.
    – Prasun Dey
    Jul 27, 2017 at 17:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .