0

I am trying to create a VS2019 project with ImageMagick (Magick++) as a statically linked library.

I have followed the directions from https://github.com/ImageMagick/ImageMagick-Windows.

In the wizard configurator I requested: Build Type: Static Multi-threaded runtimes Kept most settings to the default beyond that.

In my project I have set the header file include path to include:

C:\developer\ImageMagick\ImageMagick\

C:\developer\ImageMagick\ImageMagick\Magick++\lib

I have added library paths of:

C:\developer\ImageMagick\VisualMagick\lib

and I have added the relevant 3 library files for debug and release.. debug shown below:

CORE_DB_Magick++_.lib
CORE_DB_MagickCore_.lib
CORE_DB_MagickWand_.lib

In code I have:

#include <Magick++.h>
...
char szImageMagickLIBDirectory[MAX_PATH];
strcpy_s(szImageMagickLIBDirectory, MAX_PATH, "C:\\developer\\ImageMagick\\VisualMagick\\lib");
Magick::InitializeMagick(szImageMagickLIBDirectory);

Unortunately I get many LNK2001 unresolved external symbol errors during linking. example:

LNK2001 unresolved external symbol UnregisterGRADIENTImage  <myProjectName> <my_project_path>\CORE_DB_Magick++_.lib(static.obj) 1   

Does anyone have information on how to setup a VS project for ImageMagick:x64-windows-static library use?

My backup plan (as you may deduce from my vcpkg notation) will be to use GraphicsMagick.

Dan
  • 11
  • 5

1 Answers1

0

Well I feel a right idiot! My mistake was thinking that the all the additional LIBs had been compiled into the 3 key LIBs commonly referenced and used by ImageMagick. That simply isnt the case! Gah! The very simple answer is to add all thirty odd static libraries to the project! Thats all! I honestly thought I was dealing with some complex Linker settings issue, when the problem was simply my arrogant assumption!

I must now consume coffee to stave off the mind altering dumbness I feel!

Dan
  • 11
  • 5