简体   繁体   中英

Fatal error when compiling llvm/clang - 'cstddef' file not found

When trying to compile 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 

the following error occurs:

[...]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

But cstddef does indeed exist (in /usr/local/include/c++/4.8.0/ ). Adding --includedir=/usr/local/include/c++/4.8.0/ to the configure does not help also.

What can be the cause for this?

Try building with cmake or re-installing dependancies below

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

I ran into similar errors and installed the essential gcc-4.8 and libstdc++-4.8 libraries. Worked for me atleast.

sudo apt-get install build-essential

Good luck. Hope it works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM