macos: 10.14.4html
下载go-ethereum源码,按照文档执行命令编译:c++
$ make all git
报错:
fatal error: 'stdlib.h' file not foundmacos
/usr/includexcode
查看xcode是否安装:app
$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updatesui
$ xcode-select -p
/Applications/Xcode.app/Contents/Developercode
$ brew confightm
Clang: 10.0 build 1001
Git: 2.20.1 => /usr/local/bin/git
macOS: 10.14.4-x86_64
CLT: 10.2.0.0.1.1552586384
Xcode: 10.2
CLT headers: 10.2.0.0.1.1552586384blog
发现xcode已经安装。
使用命令查看 clang++的 include 搜索路径(#include <...> search starts here: 后面)。
$ clang++ -E -x c++ - -v < /dev/null
ignoring nonexistent directory "/usr/include/c++/v1"
ignoring nonexistent directory "/usr/include"
发现忽略了不存在的/usr/include。 说明macOS SDK 的头文件不存在。
安装llvm:
$ brew install llvm
问题仍然存在。
安装头文件:
$ cd /Library/Developer/CommandLineTools/Packages/
$ open macOS_SDK_headers_for_macOS_10.14.pkg
再次编译go-ethereum, 经过。 问题解决。
参考资料:
一、https://stackoverflow.com/que...
二、https://www.cnblogs.com/flipp...
三、https://apple.stackexchange.c...