11

尝试编译 llvm/clang 时

../llvm/configure --enable-cxx11=yes --enable-libcpp=yes 
  --enable-optimized=yes --prefix=/usr/local --enable-targets=all 
  --with-gcc-toolchain=/usr/local/bin --enable-bindings=auto 

出现以下错误:

[...]llvm/include/llvm/Support/AlignOf.h:19:10: fatal error: 'cstddef' file not found
#include <cstddef>
         ^
1 error generated.
rm: [...]/llvm_build/lib/Support/Release+Asserts/APFloat.d.tmp: No such file or directory
make[1]: *** [[...]/llvm_build/lib/Support/Release+Asserts/APFloat.o] Error 1
make: *** [all] Error 1

cstddef确实存在(在/usr/local/include/c++/4.8.0/)。添加--includedir=/usr/local/include/c++/4.8.0/到配置中也无济于事。

这可能是什么原因?

4

1 回答 1

1

尝试在下面构建cmake或重新安装依赖项

mkdir build
cd build/
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD="X86_64;JSBackend" \
-DLLVM_INCLUDE_EXAMPLES=OFF

我遇到了类似的错误并安装了基本gcc-4.8libstdc++-4.8库。至少为我工作。

sudo apt-get install build-essential

祝你好运。希望它有效

于 2014-02-23T17:32:03.837 回答