Shared Library Error

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
mfulton

Shared Library Error

Post by mfulton »

I have tried to compile and run the "wand.c" sample for MagickWand. Compiling goes fine, but when I try to run the program, I get the following error message:

wand: error while loading shared libraries: libMagickWand.so.1: cannot open shared object file: No such file or directory

The file in question, libMagickWand.so.1, is present in the lib directory so I can only conclude that the wand program itself doesn't know to to look there.

How do I fix this?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Shared Library Error

Post by magick »

Do a Google search on the ldconfig program or the LD_LIBRARY_PATH environment variable.
mfulton

Re: Shared Library Error

Post by mfulton »

Thanks for response... I've gotten a bit further now. However, neither of these ideas seem to be the "right" sort of solution.

Setting the LD_LIBRARY_PATH variable to point at the ImageMagick installation's "lib" directory did the trick, but doesn't that mean I'd have to run my MagickWand programs from a shell script so that I could set the variable first? I suppose it's doable... but it seems inelegant.

Using "ldconfig" seems like another temporary, do it before running the program solution.

Isn't there some sort of "do it once and the problem is gone" solution to this problem?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Shared Library Error

Post by magick »

You can always install ImageMagick with a /usr prefix rather than the default /usr/local prefix. Just add the --prefix option to your configure script command line.
Post Reply