我试图升级到LLVM 3.4(从源代码构建),现在Clang ++已损坏。它无法找到C++头文件。还有一个缺失C头文件的问题。例如它说fatal error: 'algorithm' file not found
。如果我在标志中添加一个手动包含C++头文件,它会抱怨没有找到string.h。在OSX Mountain Lion上重新安装破碎的Clang ++
锵++显然搜索这些路径:
$ /usr/bin/clang++ -cc1 -v
clang -cc1 version 5.0 based upon LLVM 3.3svn default target x86_64-apple-darwin12.4.0
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/clang/5.0/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
但它似乎并不包括/ usr/include目录,因为在/ usr/include包含string.h中。似乎重新安装是最好的,但是当我尝试从我下载的mpkg文件安装Xcode命令行工具时,它仍然无法工作。我必须先删除现有的LLVM/Clang吗?那唯一改变的是,我可以不再使用铛++作为它自己的命令,我认为有事情做与MacPorts的,因为在绝望中我尝试了MacPorts的版本,这也失败(同样的原因):
$ which clang++
/usr/bin/clang++
$ clang++ -cc1 -v
-bash: /opt/local/bin/clang++: No such file or directory
我使用的是OSX 10.8.4。我该如何重新安装或解决此问题?
编辑:试图重新安装LLVM/Clang的,我得到这个:
We detected a missing feature in the standard C++ library that was known to be
missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
than 4.7. You will need to update your system and ensure Clang uses the newer
standard library.
我想我会尝试再次从源重建LLVM/Clang,虽然这是首先打破它,所以我怀疑这将工作。 –
尝试使用配置选项'--enable-libcpp = yes' ... –
对于其他人,请勿在/ usr中更改/ usr/local之外的内容,以免影响Apple提供的代码。在这种情况下,为什么不重新安装Xcode或者命令行工具 - 什么是实际错误 – Mark