xcrun
我想在 Mac OS X 10.9 下构建一个现有的应用程序。该应用程序与 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
?