将 libtidy 用于 iPhone 应用程序

发布于 2024-07-15 12:18:23 字数 395 浏览 3 评论 0原文

我正在尝试将 libtidy 用于 iPhone 应用程序(因为 iPhone 2.2 SDK 不包括具有整洁功能的 NSXMLDocument),但在构建应用程序时出现链接器错误,提示“未找到 -ltidy 的库”。

至于其他框架/库引用,我已将 libtidy.dylib 添加到引用框架列表中,并将关联的 libtidy 头文件添加到“头搜索路径”构建设置中列出的路径。 当我构建应用程序时,Xcode 似乎自动添加 -ltidy 链接器选项,但它仍然抱怨找不到关联的 libtidy.dylib 文件,即使我可以在文件系统上的指定路径中看到它并在框架中列出参考。

在 Xcode 中添加对 libtidy 的引用时是否有其他人遇到过类似的问题? 我正在使用 Xcode 3.1.2 和 iPhone SDK 2.2.1。

I'm trying to use libtidy for an iPhone app (since the iPhone 2.2 SDK doesn't include NSXMLDocument which has tidy functionality) but I get a linker error saying "library not found for -ltidy" when I build the app.

As for other framework/library references, I've added the libtidy.dylib to my list of referenced frameworks and I've added the associated libtidy header files to the path listed in my Header Search Paths build setting. Xcode seems to automatically add the -ltidy linker option when I build the app yet it still complains that it can't find the associated libtidy.dylib file even though I can see it on the file system in the specified path and listed in the framework references.

Has anyone else had a similar problem when adding a reference to libtidy in Xcode? I'm using Xcode 3.1.2 with iPhone SDK 2.2.1.

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

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

发布评论

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

评论(1

海的爱人是光 2024-07-22 12:18:23

这是一个相当大的疏忽,但解决这个问题的唯一方法是手动复制这两个文件:

/Developer/SDKs/MacOSX10.5.sdk/usr/lib/libtidy.dylib
/Developer/SDKs/MacOSX10.5.sdk/usr/lib/libtidy.A.dylib

...到不同的模拟器目录中:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/usr/lib/
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.1.sdk/usr/lib/
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.sdk/usr/lib/
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/usr/lib/

不确定为什么它们一开始就不存在。 您可以从终端执行此操作:

for directory in $( echo /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator*.sdk/usr/lib/ ); do
  sudo cp /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libtidy.* $directory
done;

It's a pretty big oversight, but the only way to fix this problem is by manually coping these two files:

/Developer/SDKs/MacOSX10.5.sdk/usr/lib/libtidy.dylib
/Developer/SDKs/MacOSX10.5.sdk/usr/lib/libtidy.A.dylib

...into the different Simulator directories:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/usr/lib/
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.1.sdk/usr/lib/
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.sdk/usr/lib/
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/usr/lib/

Not sure why they weren't there in the first place. You can do this from a Terminal:

for directory in $( echo /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator*.sdk/usr/lib/ ); do
  sudo cp /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libtidy.* $directory
done;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文