构建期间未找到 iPhone libxml2
目前,我的 iPhone 项目中的 libxml2 出现了一些错误。在我的构建属性构建失败后进行一些更改之后,这之前是有效的。 (libxml2.dylib 在构建阶段添加)
#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/xmlstring.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>
我已将以下项目添加到构建设置中:
Other Linker Flags: -lxml2
Header Search Paths: /usr/include/libxml2
我尝试将它们添加到项目和目标中(同时,并在它们之间切换),没有任何区别。
我还尝试将以下内容添加到标题搜索路径:
${SDKROOT}
${SDK_DIR}
两者都没有结果。
构建失败的原因: iPhone 设备 iPhone 和 iPad 模拟器
有人有想法吗?
我正在使用 GData Objective-C 客户端库:http://code.google。 com/p/gdata-objectivec-client/ 我将源文件直接编译到我的项目中,并遵循 wiki 中给出的所有步骤。当再次手动导入 libxml 标头时,XCode 会提出以下建议:
#import <libxml2/libxml/tree.h>
这也不起作用。
I currently got some errors with libxml2 in my iPhone project. This was working before, after making some changes in my build properties building failed. (libxml2.dylib is added in the build phases)
#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/xmlstring.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>
I've added the following items to the Build Settings:
Other Linker Flags: -lxml2
Header Search Paths: /usr/include/libxml2
I've tried adding them to the project and targets (at the same time, and switching between them) without any difference.
I also tried adding the following to the Header Search Path:
${SDKROOT}
${SDK_DIR}
Both with no result.
Building fails for:
iPhone device
iPhone and iPad emulator
Anyone have an idea?
I'm using the GData Objective-C client library: http://code.google.com/p/gdata-objectivec-client/
I'm compiling the source files directly into my project and followed all the steps that are given in the wiki. When manually importing the libxml headers again, XCode suggests the following:
#import <libxml2/libxml/tree.h>
Which doesn't work either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加
${SDKROOT}/usr/include/libxml2
作为标头搜索路径,而不是仅${SDKROOT}
。请注意,所有需要 libxml 的构建目标都会获得额外的搜索路径。如果您将路径添加到项目的构建设置中,则其所有目标都将继承它,并且应该不会有问题。
Add
${SDKROOT}/usr/include/libxml2
as a header search path instead of only${SDKROOT}
.Watch out that you all build targets that need libxml get the extra search path. If you add the path to your project's build settings, all its targets will inherit it and there shouldn't be a problem.
在 PROJECT --> 中 构建阶段和目标 -->构建阶段。
in PROJECT --> Build Phases and in TARGETS --> Build Phases.