ImageMagick with Visual Studio

☆樱花仙子☆ 提交于 2019-12-06 07:19:39

问题


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:


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++

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

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.



来源:https://stackoverflow.com/questions/15664624/imagemagick-with-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!