ImageMagick with Visual Studio

2019-04-11 02:33发布

I'm trying to write a sample ImageMagick program in Visual Studio 2010. I have binary distribution of ImageMagick already installed on my system as I can use command line interface of ImageMagick.

However, when I try to include "Magick++.h" in my C++ program, it says it can't open source file.

I found the instructions on compiling and building ImageMagick from source, but is it possible to change my visual studio project settings so it can pick necessary references/libraries from the already installed version of ImageMagick?

1条回答
▲ chillily
2楼-- · 2019-04-11 02:57

I am by no means an expert, but here is what worked for me:

Using Windows7 Professional and Visual C++ Express 2010...

I checked the Install development headers and libraries for C and C++

install

At the end of the install, I got these two folders. Magick++.h lies inside include.

enter image description here

Be sure to set up your projects Additional Library Locations and Additional Include Directories and you should be able to compile your program.

Additionally: The manual suggests you need to do this for your program to work, but I did not and it still worked:

InitializeMagick(path_to_ImageMagick_DLLs);

And during my brief test, I found that Magick::Image::Magick() which changes image formats does not work in Debug mode. It does work in Release mode though.

查看更多
登录 后发表回答