ImageMagick与Visual Studio [英] ImageMagick with Visual Studio
问题描述
我正在尝试在Visual Studio 2010中编写一个示例ImageMagick程序。我已经在我的系统上安装了ImageMagick的二进制发行版,因为我可以使用ImageMagick的命令行界面。
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.
但是,当我尝试在我的C ++程序中包含Magick ++。h时,它说它无法打开源文件。
However, when I try to include "Magick++.h" in my C++ program, it says it can't open source file.
我找到了关于从源代码编译和构建ImageMagick的说明,但是是否可以更改我的visual studio项目设置,以便它可以从已安装的中选择必要的引用/库ImageMagick的版本?
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?
推荐答案
我不是专家,但这对我有用:
I am by no means an expert, but here is what worked for me:
使用Windows7 Professional和Visual C ++ Express 2010 ...
Using Windows7 Professional and Visual C++ Express 2010...
我检查了安装开发标题和库for C and C ++
在安装结束时,我得到了这两个文件夹。 Magick ++。h
位于 include
。
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);
在我的简短测试中,我发现 Magick :: Image :: Magick()
更改图像格式在调试模式下不起作用。它虽然在发布模式下工作。
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.
这篇关于ImageMagick与Visual Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!