Errors using ImageMagick in C++ project in Visual Studio 2017
Posted: 2019-07-27T02:10:20-07:00
I have a C++ project in Visual Studio 2017.
I download this and installed (while installing I added headers c++ button and related things)
https://imagemagick.org/script/download.php#windows
ImageMagick-7.0.8-56-Q16-x86-dll.exe
And I added inlude and lib folders on my project.
My project codes:
I got these errors and there are 5 error like that:
and then I added CORE_RL_magick++_.lib, CORE_RL_MagickCore_.lib, CORE_RL_MagickWand_.lib in lib folder of ImageMagick to in Linker-Input in my C++ project on Visual Studio 2017.
Then other errors disappeared and I got this error:
So I couldn't use ImageMagick in Visual Studio 2017.
Can someone help me ?
I download this and installed (while installing I added headers c++ button and related things)
https://imagemagick.org/script/download.php#windows
ImageMagick-7.0.8-56-Q16-x86-dll.exe
And I added inlude and lib folders on my project.
My project codes:
Code: Select all
#include <Magick++.h>
int main() {
Magick::Image first,second;
first.read ("c:\\1x1.png");
second.read("c:\\2x2.png");
first.composite(second, 150, 150);
first.write("c:\\0_0.png");
}
Code: Select all
1>man.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Magick::Image::~Image(void)" (__imp_??1Image@Magick@@UAE@XZ) referenced in function _main
Code: Select all
1>man.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Magick::Image::write(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?write@Image@Magick@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main
and then I added CORE_RL_magick++_.lib, CORE_RL_MagickCore_.lib, CORE_RL_MagickWand_.lib in lib folder of ImageMagick to in Linker-Input in my C++ project on Visual Studio 2017.
Then other errors disappeared and I got this error:
Code: Select all
Unhandled exception 0x51477C50 CORE_RL_MAGICK++_.dll Access violation writing location
So I couldn't use ImageMagick in Visual Studio 2017.
Can someone help me ?