Linking ImageMagick statically on windows?

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
smcallis

Linking ImageMagick statically on windows?

Post by smcallis »

I'm trying to link ImageMagick into a dll I'm making on windows, and I'm having a heck of a problem getting it to work right. Basically I'm using the Image() class in Magic++ to enable me to load an image from a URL and display it, nothing fancy. So I'm linking in the Magick++ and magick libraries, but I keep getting unresolved symbol errors:
Error 3 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Magick::Image::~Image(void)" (__imp_??1Image@Magick@@UAE@XZ)
Etc, etc, for ~Image(void), Image::operator=, Image(string) and Image(void). I've used dumpbin on the Magick++ lib file to make sure the symbols are indeed there, but to no avail. Can anyone who's done this shed some light?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Linking ImageMagick statically on windows?

Post by magick »

Go to c:\Program Files\ImageMagick-6.5.9-1-Q16\Magick_Demos and click on the button workspace. Build and execute. It should compile, link, and run without complaint. Now use this workspace as a template for your own project.
smcallis

Re: Linking ImageMagick statically on windows?

Post by smcallis »

Which package should I install specifically to get that? I have a source package that doesn't seem to have Magick_Demo
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Linking ImageMagick statically on windows?

Post by magick »

The Button workspace should be part of the Windows source distribution, however, it definitely is part of the Windows static binary distribution @ http://magick.imagemagick.org/script/bi ... hp#windows.
smcallis

Re: Linking ImageMagick statically on windows?

Post by smcallis »

ImageMagick-6.5.9-1-Q16-windows-static.exe is what I was installing, but the only folders I see in C:\Program Files\ImageMagick-6.5.9-Q16 are "images", "uninstall" and "www", along with several .exe and .dll files. Nothing else...
smcallis

Re: Linking ImageMagick statically on windows?

Post by smcallis »

Any thoughts anyone?
davedowns

Re: Linking ImageMagick statically on windows?

Post by davedowns »

Try installing using the DLL installer, that gave me the option to install the C/C++ headers and libraries and included the static as well as dynamic versions.
Post Reply