将 GraphicsMagick 添加到 Xcode 项目

发布于 2024-09-08 23:00:44 字数 676 浏览 3 评论 0原文

我已经在 Xcode 中创建了一个基础工具,并且想要使用 GraphicsMagick 图像处理库中的一些功能。该库已使用 MacPorts 编译并安装在我的计算机上。我将 libGraphicsMagick.3.dyliblibGraphicsMagickWand.2.dylib 作为外部框架添加到我的项目中。

要在应用程序中使用这些库,我还必须采取哪些其他步骤,以及如何导入它们的标头以在我的代码中使用它们的函数?

谢谢

更新:取得了一些进展。使用 .a 静态库而不是 dylib,将它们添加到我的项目中,然后添加 magickwand 的头文件。我正在尝试编译,但出现此错误: 替代文本 http://cl.ly/f4233cddbae23e1a19fc/content

I have created a Foundation Tool in Xcode, and want to use some functions from the GraphicsMagick image manipulation library. The library has been compiled and installed on my computer using MacPorts. I added libGraphicsMagick.3.dylib and libGraphicsMagickWand.2.dylib to my project as external frameworks.

What other steps must I take to use these libraries in my application, and how would I import their headers to use their functions in my code?

Thanks

UPDATE: Made some progress. Used the .a static libraries instead of the dylibs, added them to my project, then added the header files for magick and wand. I'm trying to compile, but I get this error:
alt text http://cl.ly/f4233cddbae23e1a19fc/content

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淑女气质 2024-09-15 23:00:44

搜索了一下,显然出现这个问题是因为 GraphicsMagick 和 ImageMagick 使用的 2 个 typedef enum 声明已经在 OS X 框架头文件中定义。有问题的枚举是 ColorInfoExceptionInfo

解决这个问题的唯一方法是遍历源代码并将这些枚举的每次出现都重命名为尚未使用的新名称。然而,iPhone 没有这个问题,GraphicsMagick 可以正常编译。不幸的是,我不认为该库背后的人愿意重命名他们的枚举只是为了让它在 OS X 上编译。

Searched around a bit, and apparently this problem occurs because 2 of the typedef enum declarations that GraphicsMagick and ImageMagick use are already defined in OS X framework headers. The enums in question are ColorInfo and ExceptionInfo.

The only way to fix it is to go through the source and rename every occurance of those enums to a new name that isn't already taken. However, the iPhone does not have this issue and GraphicsMagick will compile just fine. Unfortunately, I don't think the people behind the library are willing to rename their enums just to get it to compile on OS X.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文