Xcode 3.2.5 和 Xcode 上的链接错误 libxml2.dylib软件开发工具包4.2
我正在尝试使用 oauth 库连接到 twitter。该库需要添加libxml2.dylib。将其添加到 SDK 4.1 或更低版本时,项目构建成功。但是当我将其与 xcode 3.2.5 和 SDK 4.2 一起使用时,我收到了有关缺少标头的错误,
我只需将 libxml2.dylib 添加到框架中,然后从目标配置中将“${SDKROOT}/usr/include/libxml2”添加到标头搜索中小路。
我收到错误:libxml/xmlreader.h:没有这样的文件或目录。
我试图添加的 twitter oauth 库是 Twitter+OAuth,这里有一个教程,您可以在其中看到它的 src 项目,在 SDK 4.1 上可以正常工作,甚至不能在 SDK4.2 上编译 http://mobile.tutsplus.com/tutorials/iphone/twitter-api-iphone/
我什么错过?
I am trying to connect to twitter using oauth library. The library needs libxml2.dylib to be added. When adding this to SDK 4.1 or less the project build successfully. But when I use that with xcode 3.2.5 and SDK 4.2 I got errors about missing headers
I just add the libxml2.dylib to frameworks then from target configuration I add "${SDKROOT}/usr/include/libxml2" to the header search path.
I got error: libxml/xmlreader.h: No such file or directory.
the twitter oauth library I am trying to add is Twitter+OAuth, here's a tutorial where u can see that the src project it has, works correctly on SDK 4.1, and not even compile at SDK4.2 http://mobile.tutsplus.com/tutorials/iphone/twitter-api-iphone/
what I miss?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
经过尝试几件事后,我发现我必须将标头搜索路径更改为 /usr/include/libxml2/** 而不是 ${SDKROOT}/usr/include/libxml2/**
After trying several things, I found I have to change the header search path to /usr/include/libxml2/** instead of ${SDKROOT}/usr/include/libxml2/**
选择“所有配置”(我更喜欢项目信息,除非我有非常不同的目标),双击标题搜索路径字段,输入路径并确保选中“递归”复选框。生成的路径应有 2 个星号。如果您为项目设置了标头搜索路径,则所有目标都应正确继承它。
您链接到的教程在项目/目标设置方面有点不一致,这几乎肯定是问题所在。我已经验证 SDK 4.2 中存在 xmlreader.h。
Select "All Configurations" (I prefer the project info unless I have very different targets), double-click the header search path field, enter the path and make sure to check the "Recursive" checkbox. The resulting path should have 2 asterisks. If you set the header search path for the project, all the targets should inherit it properly.
The tutorial you linked to is a bit inconsistent with regard to project/target settings, which is almost certainly the issue. I have verified that xmlreader.h is present in SDK 4.2.
我遇到了同样的问题,然后我意识到我只是在目标部分中添加标题搜索路径,而不是在项目中..确保它在两侧。
I had the same issue, then i realized that i was only adding the header search path in the target section, and not in the project.. be sure that it is in both sides.