views:

45

answers:

1

Hi,all:

I create an application by linking the libociei.so and libcustome.so

CC -o main main.cpp ../lib/libociei.so ../lib/libcustome.so

and copy libociei.so libcustome.so to /usr/lib

then I use ldd to check library, it shows:

   main .....
   libcustome.so  ===>   /usr/lib/libcustome.so
   ../lib/libociei.so

why libociei.so is not relocated to /usr/lib/libociei.so ?

ps : ld library path is /lib:/usr/lib and I do not add ../lib to ld library path

A: 

If you are on linux (say Ubuntu) then it is probably because you did not run:

sudo ldconfig

On other systems I am not so sure.

Robert Massaioli
I don't know why libcustome.so is OK ?
That response does not make much sense? My suggestion now would be to try and clarify your question and read more about how shared objects work.
Robert Massaioli