我想在MacOSX10.9下使用xcrun构建一个现有的应用程序。该应用程序与libxml集成。它附带了如下内容:
#include <libxml/parser.h>为了进行测试,我运行:
echo '#include <libxml/parser.h>' | xcrun clang -xc -v -这给了我
#include "..." search starts here:
#include <...> search starts here:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks (framework directory)
End of search list.
<stdin>:1:10: fatal error: 'libxml/parser.h' file not found
#include <libxml/parser.h>当关键的头搜索路径出现在xcrun下时,libxml2却不见了。事实上,libxml/*.h驻留在
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include即
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2如何将此目录(.../usr/include/libxml2)添加到xcrun遵循的搜索路径中
发布于 2014-01-18 11:41:30
单击project Navigator顶部的项目,然后确保选择了适当的目标。在靠近屏幕顶部中心的位置,单击"Build Settings“。现在转到“搜索路径”部分,找到您想要编辑的路径(例如,框架搜索路径、标题搜索路径、库搜索路径)。将有几列,因为您可以在项目级别、xcconfig文件中、目标级别等配置这些变量,并且筛选出的终极值将显示在“已解析”列中。选择适合您的级别,然后双击该字段并键入您的路径。
注意:如果路径中有空格,应该用双引号括起来;但是,目前Xcode中存在一个bug,它会导致Xcode偶尔重新解释搜索路径字符串并对其进行双转义。因此,当您输入"my/path/here“时,Xcode将其存储为\"my/path/here\”,这是正确的。但是稍后Xcode可能会将其存储为\"my/path/here\“,这意味着Xcode试图从\"my/path/here\”中提取文件,这会导致失败。因此,如果出现这种情况,就去掉双重转义。
https://stackoverflow.com/questions/21189896
复制相似问题