mac m1 pcre.h 找不到

报错:

vendor/git.in.zhihu.com/arches/golang-pkg-pcre/src/pkg/pcre/pcre.go:52:10: fatal error: 'pcre.h' file not found

解决:
brew install pcre

找到这个文件的地址
brew list pcre | grep 'pcre.h$'
/opt/homebrew/Cellar/pcre/8.45/include/pcre.h

程序搜索的地址
cpp -v

/Library/Developer/CommandLineTools/usr/include # 这个地址

brew 安装地址和程序搜索地址不一样,所以需要软链过去
sudo ln -s /opt/homebrew/Cellar/pcre/8.45/include/pcre.h /Library/Developer/CommandLineTools/usr/include

你可能感兴趣的:(mac m1 pcre.h 找不到)