Difference Between .So.0 and .So.0.0.0 Files

Problems when linking shared library

gcc looks for libhello.so when linking a new program. libhello.so.0 is used when the dynamic dependencies of an already linked program are searched.

In other terms: gcc -o main main.o -lhello -L. looks for libhello.so, and ./main looks for libhello.so.0. This allows to have multiple versions of a library available for legacy programs while precisely identifying the library that matches the installed headers.

A symlink libhello.so -> libhello.so.0.0.0 should do the trick.

libhdfs - cannot open shared library libhdfs.so.0.0.0.0

You can try ldconfig $HADOOP_HDFS_HOME/lib/native

What do the numbers behind a library mean?

What do all these numbers mean?

These are called external library versioning. You can read a detailed explanation here.

RedLevel1 and Cannot open shared object file: No such file or directory

This really shows how much of a rookie I am, but the problem seemed to have resolved after running make clean and running make a second time.

shared library--libvw.so.0--is missing

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



Related Topics



Leave a reply



Submit