cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with shared libraries

jenny99
Occasional Visitor

Problems with shared libraries

Hello!

I have a problem with shared dynamic libraries in HP-UX:
After compiling and linking, when I do an ldd over the executable file, it refers to libraries with absolute paths, so i find problems to execute the program in other machines, because the path does no exist.
A piece of the ldd result is:
/usr/lib/libdld.2 => /usr/lib/libdld.2

As you can see, the libraries refer to absolute paths, instead of relative paths:
./libdld.2 -> usr/lib/libdld.2

Any ideas about the problem??
Thank you in advance
2 REPLIES
Dennis Handly
Acclaimed Contributor

Re: Problems with shared libraries

>it refers to libraries with absolute paths

This is an illusion. If you have enabled embedded (ld's +b) or SHLIB_PATH (ld's +s), you can use those paths on other machines.

>A piece of the ldd result is:
/usr/lib/libdld.2 => /usr/lib/libdld.2

It is illegal to use this as an example since libdld is always there and can't be moved. Your example should include YOUR shlibs.
Dennis Handly
Acclaimed Contributor

Re: Problems with shared libraries

You can also have paths with $ORIGIN.