更新到Xcode 7.0.1和El Capitan后找不到'libxml / xmlwriter.h'

时间:2015-10-19 15:16:30

标签: xml xcode7 osx-elcapitan ns-3

我刚刚将MacBook更新为 El Capitan ,现在我已经 Xcode 7.0.1 了。在编译我的NS-3脚本时,我收到以下错误(我在更新之前没有):

 In file included from ../src/config-store/model/config-store.cc:11:
    ../src/config-store/model/xml-config.h:5:10: fatal error: 'libxml/xmlwriter.h' file not found
    #include <libxml/xmlwriter.h>
             ^
    1 error generated.
    Waf: Leaving directory `/Users/marcogiordani/final-ns3-mmwave-dir/build'
    Build failed
     -> task in 'ns3-config-store' failed (exit status 1): 
        {task 4469735696: cxx config-store.cc -> config-store.cc.1.o}
    ['/usr/bin/g++', '-Wall', '-Werror', '-Wno-potentially-evaluated-expression', '-Wno-unused-local-typedefs', '-fPIC', '-I.', '-I..', '-I/usr/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_SQLITE3=1', '../src/config-store/model/config-store.cc', '-c', '-o', 'src/config-store/model/config-store.cc.1.o']

对此问题的任何建议?

2 个答案:

答案 0 :(得分:2)

对于它可能关心的人,我刚刚在终端上输入了解决问题:

xcode-select —-install

出于某种原因,当更新到Xcode 7.0.1时,CommandLineTool也没有更新,所以我手动完成了。现在一切正常。

答案 1 :(得分:2)

使用macOS Mojave对此进行更新:在同时安装了xcode-select --install的CLI工具和带有brew的libxml2 / libxslt后,我仍然遇到问题。 解决此问题的唯一方法是安装缺少的旧标头,如下所示:https://silvae86.github.io/sysadmin/mac/osx/mojave/beta/libxml2/2018/07/05/fixing-missing-headers-for-homebrew-in-mac-osx-mojave.html

只需运行 sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / 然后你就去了!