我运行了./configure
,但是当我尝试时make
llvm
,出现以下错误:
[ 0%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o
In file included from /opt/static_analysis/llvm/include/llvm/Support/SwapByteOrder.h:19:0,
from /opt/static_analysis/llvm/include/llvm/Support/MathExtras.h:18,
from /opt/static_analysis/llvm/include/llvm/ADT/SmallVector.h:20,
from /opt/static_analysis/llvm/include/llvm/ADT/ArrayRef.h:14,
from /opt/static_analysis/llvm/include/llvm/ADT/APInt.h:19,
from /opt/static_analysis/llvm/include/llvm/ADT/APFloat.h:20,
from /opt/static_analysis/llvm/lib/Support/APFloat.cpp:15:
/opt/static_analysis/build/include/llvm/Support/DataTypes.h:77:3: error: #error "Don't have a definition for uint64_t on this platform"
# error "Don't have a definition for uint64_t on this platform"
^make[2]: \*** [lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o] Error 1
make[1]: \*** [lib/Support/CMakeFiles/LLVMSupport.dir/all] Error 2
make: \*** [all] Error 2
PS 我尝试按照以下说明进行安装 -入门:构建和运行 Clang
答案1
我遇到了同样的问题,并通过安装较新版本的 gcc 解决了该问题,这基本上是该线程中的答案:如何在 Ubuntu 上使用最新的 GCC?
我猜测较新版本的 Ubuntu(15)会自动解决这个问题,因为那里的默认 gcc 已经是 4.9 了。
答案2
我遇到了同样的问题,我通过清除 CMake 缓存解决了这个问题。只需删除CMakeCache.txt
并尝试再次运行make
。CMakeCache.txt
应该位于您尝试执行 CMake 命令的同一目录中。