Page 1 of 1

Magick++ API Link errors

Posted: 2020-02-11T06:02:22-07:00
by rdf
Hi,

I installed ImageMagick-7.0.9-22-Q16-x64-dll on Windows 10. I have issues compiling my first project using the Magick++ API using Visual Studio.

I included the ..\lib folder and added the three library files inside the ..\lib folder, CORE_RL_Magick++_.lib, CORE_RL_MagickCore_.lib and CORE_RL_MagickWand_.lib, as dependency to my project.
I copied the corresponding DLL files, CORE_RL_Magick++_.dll, CORE_RL_MagickCore_.dll and CORE_RL_MagickWand_.dll, to my project.

I am trying to compile the example program at https://imagemagick.org/script/magick++.php, but the linker cannot find the Magick++ API functions. I get the following errors:
Error 1 error LNK2019: unresolved external symbol "void __cdecl Magick::InitializeMagick(char const *)" (?InitializeMagick@Magick@@YAXPBD@Z) referenced in function _main c:\Users\user\documents\visual studio 2013\Projects\TestProject\TestProject\main.obj TestProject
Error 2 error LNK2019: unresolved external symbol "public: __thiscall Magick::Geometry::Geometry(unsigned int,unsigned int,long,long)" (??0Geometry@Magick@@QAE@IIJJ@Z) referenced in function _main c:\Users\user\documents\visual studio 2013\Projects\TestProject\TestProject\main.obj TestProject
Error 3 error LNK2019: unresolved external symbol "public: __thiscall Magick::Geometry::~Geometry(void)" (??1Geometry@Magick@@QAE@XZ) referenced in function _main c:\Users\user\documents\visual studio 2013\Projects\TestProject\TestProject\main.obj TestProject
Error 4 error LNK2019: unresolved external symbol "public: __thiscall Magick::Image::Image(void)" (??0Image@Magick@@QAE@XZ) referenced in function _main c:\Users\user\documents\visual studio 2013\Projects\TestProject\TestProject\main.obj TestProject
Error 5 error LNK2019: unresolved external symbol "public: virtual __thiscall Magick::Image::~Image(void)" (??1Image@Magick@@UAE@XZ) referenced in function __catch$_main$0 c:\Users\user\documents\visual studio 2013\Projects\TestProject\TestProject\main.obj TestProject
Error 6 error LNK2019: unresolved external symbol "public: void __thiscall Magick::Image::crop(class Magick::Geometry const &)" (?crop@Image@Magick@@QAEXABVGeometry@2@@Z) referenced in function _main c:\Users\user\documents\visual studio 2013\Projects\TestProject\TestProject\main.obj TestProject
Error 7 error LNK2019: unresolved external symbol "public: void __thiscall Magick::Image::read(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?read@Image@Magick@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main c:\Users\user\documents\visual studio 2013\Projects\TestProject\TestProject\main.obj TestProject
Error 8 error LNK2019: unresolved external symbol "public: void __thiscall Magick::Image::write(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?write@Image@Magick@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main c:\Users\user\documents\visual studio 2013\Projects\TestProject\TestProject\main.obj TestProject
Error 9 error LNK1120: 8 unresolved externals c:\users\user\documents\visual studio 2013\Projects\TestProject\Debug\TestProject.exe TestProject
If I try to use the Magick++ Demo, and replace CORE_RL_magick_.lib with CORE_RL_MagickCore_.lib (as described in another post https://imagemagick.org/discourse-serve ... 23&t=37450), I get similar errors.

Am I missing something? Do I need more library files than just those 3 in the ../lib folder? Or do I need more DLL files?

Hopefuly someone can point me in the right direction. Thanks