ImageMagick with Magick++ on the Mac

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
imcz

ImageMagick with Magick++ on the Mac

Post by imcz »

Hi

I have programmed a application which is using ImageMagick's C++ API. On Windows, the ImageMagick DLL's have to be in the search path in order to find the libraries. There is also a parameter to MagickLib::InitializeMagick(szPath);
which is getting the library directory.

On the Mac, I have installed the ImageMagick libraries to /op/local/lib (I installed the binary distribution of them, without using MacPorts). On the Mac where I compiled my application, it can find the libraries and works fine.

But when I want to try the compiled app on a different Mac, it won't start because it cannot find the ImageMagick DYLD's. I have put them on the very same place /opt/local/lib, have set the environment variables in .profile, and so on.
But it doesn't work.

Now the question: Where do I have to put the DYLD's or where do I have to change settings in order to let it work.

The strange thing is, that on the development mac (where I compiled it), I removed the entries in .profile. The command line tools of ImageMagick don't work anymore, but my app can pick up the libraries somehow.
I am not a big Mac guru, so can it be, that the library location is bind during compiletime to the app?

On the Mac, the MagickLib::InitializeMagick(szPath); function doesn't require the correct path set, also I have tried to do so without success.

Any help, hints or tips are welcome.

Thanks in advance.

Michael
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick with Magick++ on the Mac

Post by magick »

Try setting your DYLD_LIBRARY_PATH environment variable to /opt/local/lib.
imcz

Re: ImageMagick with Magick++ on the Mac

Post by imcz »

Thanks, but I have tried this. I did on the second mac (the non-developer Mac) all I did to install ImageMagick, set the DYLD_LIBRARY_PATH, the MAGICK_HOME, etc to the correct values and have stored those in the .profile within my home directory. But those are not relevant. On the non-developer machine it doesn't work with them set and on the developer machine it can find the libraries even with the path information deleted out of .profile.

So it's really difficult for me now to proceed. How do other applications on the Mac find their libraries? Is there a similar way to find DLL's on Windows? I mean now general. Haven't found much about this on the net. But maybe I am searching for the wrong keywords.

Am I right that the path variables are only good for starting programms in a terminal. I looked around and it seems that for web server etc. the variables have to be set in their own configuration files to work. So I am really stuck since it's just an application which has ImageMagick as dependency. How could this possibly pick up the path variables. My application won't even load at all. So I cannot add anything to my code.
Post Reply