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

'libxml/xmlwriter.h' not found after updating to Xcode 7.0.1 and El Capitan

我刚刚将我的 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']

对这个问题有什么建议吗?

可能有问题的人,我刚刚通过在终端上输入解决了这个问题:

xcode-select —-install

由于某些原因,更新到Xcode7.0.1时,CommandLineTool也没有更新,所以我手动更新了。现在一切正常。

使用 macOS Mojave 对此进行更新:使用 xcode-select --install 安装 CLI 工具和使用 brew 安装 libxml2 / libxslt 后,我​​仍然遇到问题。 唯一解决问题的方法是安装遗失的旧版 headers,如此处所指出: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 / 好了!