Re: Problem with shared library

Bob Friesenhahn <[email protected]> Fri, 16 Oct 2020 18:40:06 -0500 (CDT)
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
On Fri, 16 Oct 2020, Kent Tenney wrote:

> gm fails with
> "gm: error while loading shared libraries: libGraphicsMagick.so.3: cannot
> open shared object file: No such file or directory"
>
> The file and the one it links to:
> /usr/local/lib/libGraphicsMagick.so.3 -> libGraphicsMagick.so.3.21.0
>
> both look fine.
> Suggestions?

If /usr/local/lib/libGraphicsMagick.so.3.21.0 does exist, then I 
suspect a 'ldconfig' issue.

Check the output of '/sbin/ldconfig -p' to see if it is helpful.

On my Ubuntu 18 system, the file /etc/ld.so.conf.d/libc.conf says 
this:

# libc default configuration
/usr/local/lib

Perhaps Ubuntu 20 has removed this default.

Using 'sudo /sbin/ldconfig /usr/local/lib' may temporarily (until the 
next reboot) fix the issue.

If you don't want to change the system library search defaults, then 
add this to the configure options:

   'LDFLAGS=L/usr/local/lib -Wl,-rpath,/usr/local/lib'

The -rpath option will cause the binary to remember the path to the 
library.  This is something that I often do because I want full 
control over the libraries used.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt