Confused about missing delegates and static MT libraries

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
vtagle-qsi
Posts: 12
Joined: 2008-09-05T16:30:03-07:00

Confused about missing delegates and static MT libraries

Post by vtagle-qsi »

Can someone shed some light on this situation? I'm using the static multi-threaded libraries for Magick++ which from what I can understand, lets you link in all that you need statically so that you don't need the DLL modules. However, when I execute the following line of code:

Code: Select all

Magick::Image svgImage("test.png"); 
a Missing Delegate exception gets thrown. Is there something more I have to do such as putting additional files next to my executable? Putting the XML config files didn't seem to help matters, either.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Confused about missing delegates and static MT libraries

Post by fmw42 »

If you installed from source, you will need to install any delegate library you want for various image formats: jpg, tiff, png, etc

To check your delegates:

convert -list configure

Then look at the line that starts with DELEGATES.

The libraries can be found at
http://www.imagemagick.org/download/delegates/

you will need to install any that you want to use.
vtagle-qsi
Posts: 12
Joined: 2008-09-05T16:30:03-07:00

Re: Confused about missing delegates and static MT libraries

Post by vtagle-qsi »

Okay. But I thought the purpose of building the static libraries was that so you could create a portable version of IM that you could link into an application and then run that application on another machine without having to have IM installed on that machine. Or am I misunderstanding the purpose of building the static multi-threaded libraries? Should I be asking this question in the MagickWand forum?

These are the libraries I'm linking into my application (for the debug version, at least):
CORE_DB_jpeg_.lib CORE_DB_lcms_.lib CORE_DB_libxml_.lib CORE_DB_magick_.lib CORE_DB_Magick++_.lib CORE_DB_png_.lib CORE_DB_tiff_.lib CORE_DB_ttf_.lib CORE_DB_wand_.lib CORE_DB_wmf_.lib CORE_DB_zlib_.lib

CORE_DB_png_.lib is already in there so I assume that's what I need to handle PNG file so this is why I'm confused about the missing delegate exception.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Confused about missing delegates and static MT libraries

Post by magick »

Download and install the ImageMagick Windows static distribution. Go to the c:\Program Files\ImageMagick-6.4.3-Q16\Magick++_demos folder. Click on the button workspace and build and run. Does this workspace run ok? If so, use the button workspace as a template for your own project.
vtagle-qsi
Posts: 12
Joined: 2008-09-05T16:30:03-07:00

Re: Confused about missing delegates and static MT libraries

Post by vtagle-qsi »

Okay. I've done this and made some changes to the source for the button demo to do what I need so I'll attempt to use this project as my template. I assume it's using the Dynamic Multi-threaded DLL runtimes build option. However, my initial question really isn't being answered here. I'm just trying to figure out if how I understand the different build options work are correct. Really, I just want to know if the Static Multi-threaded runtimes build option is supposed to do what I think it does which is to allow an application to link to statically link to IM and get everything it needs to do and if it doesn't what else do I need to do to make it work. Being told to install delegates (which appears to be good advice if I'm using the command-line programs but I'm not) or to just use the demo projects as a starting point (again, not bad advice) doesn't really help my understanding of how IM is supposed to work. I'm not trying to offend here, I'm just trying to get some straight answers to the questions I've been asking.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Confused about missing delegates and static MT libraries

Post by magick »

Have you read http://www.imagemagick.org/script/advan ... lation.php? It discusses the different ImageMagick builds under Windows. The static build includes all the standard delegate libraries such as JPEG and PNG and does not include any DLL's. The demo workspace is recommended as a starting point for linking all the required static libraries. For the smallest footprint for your application, you can bundle your application and all the static ImageMagick libraries and configuration files into one folder. ImageMagick will look for its dependencies in the same folder as your application (e.g. color.xml, delegate.xml, etc).
vtagle-qsi
Posts: 12
Joined: 2008-09-05T16:30:03-07:00

Re: Confused about missing delegates and static MT libraries

Post by vtagle-qsi »

Okay, using the workspaces of the static MT demos, I was able to get IM working in my project. Thanks for all the help, everyone. :D
hakiim35
Posts: 19
Joined: 2010-02-18T07:04:01-07:00
Authentication code: 8675308

Re: Confused about missing delegates and static MT libraries

Post by hakiim35 »

Hello, I have been suffering from the same problem.
First I build the libraries exactly as it is told in http://www.imagemagick.org/script/insta ... hp#windows under the heading Install from Windows Source
Then, I link all the produced libraries into my application but I get many linkage errors.
As the solution offered by "magick", I installed the newest static versions 6.6.2-5-Q16 and Q8 but none of them includes a "Magick++_demos" directory.
I have also searched for the older ImageMagick-6.4.3-Q16 version on the net but I could't find.
Would anyone help me about the proper settings for the project?
thanks.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Confused about missing delegates and static MT libraries

Post by Drarakel »

hakiim35 wrote:I have also searched for the older ImageMagick-6.4.3-Q16 version on the net but I could't find.
See e.g. here. (But I don't think that this solves the problem.)
hakiim35
Posts: 19
Joined: 2010-02-18T07:04:01-07:00
Authentication code: 8675308

Re: Confused about missing delegates and static MT libraries

Post by hakiim35 »

Thank you.
I have just installed it but it does not include a Magick++_demos directory inside..
Post Reply