Error compiling Rust project:
error: failed to run custom build command forCroaring - sys v0.3.7 process didn't exit successfully: /Users/... /grin/target/release/build/croaring-sys-20d6d5c35e3a436a/build-script-build (exit code: 101) --- stdout TARGET = Some("x86_64-apple-darwin") OPT_LEVEL = Some("3") HOST = Some("x86_64-apple-darwin") CC_x86_64-apple-darwin = None CC_x86_64_apple_darwin = None HOST_CC = None CC = None CFLAGS_x86_64-apple-darwin = None CFLAGS_x86_64_apple_darwin = None HOST_CFLAGS = None CFLAGS = None DEBUG = Some("false") running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-Wall" "-Wextra" "-std=c11" "-march=native" "-O3" "-o" "/Users/... /grin/target/release/build/croaring-sys-4f7af44253f571e8/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c"Copy the code
The key error message is:
error: unknown type name 'uint64_t' cargo:warning= uint64_t ri resident_size;
Copy the code
The reason is that the C++. H is not correct after upgrading the Mac system. The solution is to delete the clang-related compilation environment and reinstall it, first removing the header file:
rm -rf /usr/local/include/*
Uninstall the LLVM toolchain
brew uninstall llvm
Finally, you need to uninstall the Xcode command line tool:
rm -rf /Library/Developer/CommandLineTools
After uninstalling the Clang-related tools, reinstall them. Install Xcode command line tool:
xcode-select –install
Install the LLVM
brew install –with-toolchain llvm
Recompilation is ok.