Page 1 of 1

Shared Library Error

Posted: 2009-07-19T13:09:39-07:00
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?

Re: Shared Library Error

Posted: 2009-07-19T13:23:11-07:00
by magick
Do a Google search on the ldconfig program or the LD_LIBRARY_PATH environment variable.

Re: Shared Library Error

Posted: 2009-07-19T17:14:26-07:00
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?

Re: Shared Library Error

Posted: 2009-07-19T17:18:12-07:00
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.