简体   繁体   English

lex中的libxml2没有发现?

[英]libxml2 in leopard unfound?

I read somewhere that libxml2 is available in XCode4. 我在某地读过libxml2在XCode4中可用。 However, I'm getting a lot of errors running Product > Profile. 但是,我在运行Product> Profile时遇到了很多错误。 The current Header Search Paths for Adhoc and Debug is set to: /usr/include/libxml2 Adhoc和Debug的当前Header Search Paths设置为: /usr/include/libxml2

But when I browse through this physical path in Snow Leopard, there is no libxml2 there. 但是当我在Snow Leopard中浏览这个物理路径时,那里没有libxml2。 Here is a sample error: 这是一个示例错误:

*:No such file or directory
Libxml/tree.h: No such file or directory.

'*' undeclared here (not in a function)
'XML_ELEMENT_NODE' undeclared here (not in a function)

'*' undeclared here (not in a function)
'XML_ATTRIBUTE_NODE' undeclared here (not in a function)

Open up the build settings for your iPhone App project and set 打开iPhone App项目的构建设置并进行设置

  • Other linker flags = -lxml2
  • and Header Search Paths: $(SDKROOT)/usr/include/libxml2 or Header Search Paths:/usr/include/libxml2 Header Search Paths: $(SDKROOT)/usr/include/libxml2 Header Search Paths:/usr/include/libxml2

When developping under XCode, GCC uses the -isysroot option that relocates the root of the SDK. 在XCode下进行开发时,GCC使用-isysroot选项重定位SDK的根目录。 If you add /usr/include/libxml2 in the header search paths, it will be translated at compilation time to the usr/include/libxml2 folder INSIDE the current SDK. 如果在头文件搜索路径中添加/usr/include/libxml2 ,则会在编译时将其转换为当前SDK中的usr/include/libxml2文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM