如何为Xcode项目和iOS应用程序制作libtiff? [英] How to make libtiff for an Xcode project and an iOS application?

查看:96
本文介绍了如何为Xcode项目和iOS应用程序制作libtiff?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在上下搜索stackoverflow和Google,以便正确地编译并将 libtiff 库添加到我在Xcode中的现有iOS项目中。

I have been searching up and down stackoverflow and Google for the correct way to compile and add the libtiff library to my existing iOS project in Xcode.

到目前为止我做了什么:

What I have done so far:

编辑:

我决定按照计算器。我使用版本 3.9.6 并在此处构建它教程及其续集。在评论中,我找到了一个脚本,我可以适应。我已将生成的dependencies文件夹添加到我的Xcode项目中,几乎与 rakmoh 建议一样。

I have downloaded libtiff to my Mac after deciding to follow this advice on stackoverflow. I used version 3.9.6 and built it like in this tutorial and its sequel about SDK5. There, in the comments, I found a script I could adapt. I have added the resulting "dependencies" folder to my Xcode project, almost like rakmoh suggested.

但是,一旦我 #include tiffio.h

Undefined symbols for architecture armv7:  "_inflateEnd", referenced from:
  _PixarLogCleanup in libtiff.a(tif_pixarlog.o)
  _ZIPSetupEncode in libtiff.a(tif_zip.o)
.
... some more...
.
ld: symbol(s) not found for architecture armv7 
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我还尝试了最新版本的 libtiff ,但这并没有改变一件事,所以我去了回到3.9.6,因为它与项目中的其他软件兼容。然后我问了一位发现缺少 libz 库的同事。从日志文件中他看到它在编译 libtiff 期间一直存在,并且我的Xcode项目中的链接器仍然缺少它。瞧!当我将它添加到框架(使用小+符号并浏览 libz.dylib 列表)时,我的空测试项目已编译。

I also tried the newest version of libtiff, but that did not change a thing, so I went back to 3.9.6, as it is compatible with the other softwares in the project. Then I asked a colleague who found out it was the libz library missing. From the log files he saw it must have been there during the compilation of libtiff and it was still missing for the linker in my Xcode project. And lo! When I added it to the frameworks (with the little + sign and browse the list for libz.dylib), my empty test project compiled.

在写答案之前,我想做更多测试,但我已经将成功的shell脚本更新为引擎收录

Before writing an answer, I would like to do some more testing, but I have already updated the successful shell script to pastebin.

感谢您的帮助!

推荐答案

我贴了一个 bash脚本交叉编译 libtiff 版本 3.9.6 在Mac for iOS 6.1上用于设备和在模拟器中。您必须根据自己的需要进行调整。另见教程提示。它为两个编译目标创建了一个胖库。

I have pasted a bash script that cross-compiles libtiff version 3.9.6 on a Mac for iOS 6.1 to be used on devices and in the simulator. You will have to adapt it to your needs. Also see this tutorial for hints. It creates a fat library for both compilation targets.

rakmoh 答案也是正确的,但只是部分解决方案。你在他建议的添加其他...对话框中添加带有胖库的文件夹。

rakmohs answer is also correct, but only part of the solution. You add the folder with the fat library in the "Add Other.." dialogue he proposes.

然后你还要添加libz.dylib!之后,我可以在我的设备和模拟器上的应用程序中使用 libtiff

Then you also add libz.dylib! After that, I could use libtiff in my app on my device and on the simulator.

这篇关于如何为Xcode项目和iOS应用程序制作libtiff?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆