xcode 错误:libxml/parser.h:没有那个文件或目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5636144/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:48:30  来源:igfitidea点击:

error: libxml/parser.h: No such file or directory

objective-cxmlxcode

提问by Thromordyn

I'm attempting to use XML (Chapter 10 in Professional iPhone and iPad Database Application Programming), and I've run into a bit of trouble.

我正在尝试使用 XML(专业 iPhone 和 iPad 数据库应用程序编程第 10 章),但遇到了一些麻烦。

Under Header Search Pathsin Build SettingsI have this path:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/libxml2/

Header Search PathsBuild Settings我有这样的路径:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/libxml2/

That's all fine and well, but then:

这一切都很好,但是:

#import <libxml/parser.h>
#import <libxml/tree.h>
error: libxml/parser.h: No such file or directory

If I flip the imports:

如果我翻转进口:

#import <libxml/tree.h>
#import <libxml/parser.h>
error: libxml/tree.h: No such file or directory

Weird.

奇怪的。

For now I have this:

现在我有这个:

#import <libxml/catalog.h> // Dirty hack
#import <libxml/parser.h>
#import <libxml/tree.h>
error: libxml/catalog.h: No such file or directory

But that's no good for a production app.

但这对生产应用程序没有好处。

回答by Joe

Try changing your header search path to ${SDK_DIR}/usr/include/libxml2.

尝试将标题搜索路径更改为${SDK_DIR}/usr/include/libxml2.

回答by Thromordyn

As it turns out, it was a trivial fix. I closed the project to work on another, and when I reopened it, the error was gone. Not exactly what I would have expected, but hey, it works now.

事实证明,这是一个微不足道的修复。我关闭了该项目以处理另一个项目,当我重新打开它时,错误消失了。不完全是我所期望的,但是嘿,它现在可以工作了。

"When in doubt, reboot."

"When in doubt, reboot."