macOS下使用Boost 1.76编译cc-tool报错无法找到Boost regex链接参数如何解决
macOS Big Sur下编译cc-tool Boost regex链接错误解决方案
首先确认已安装所有基础依赖:
- 执行brew安装命令:
brew install boost libusb pkg-config
接下来根据你的Mac芯片类型选择对应的配置命令,替代默认的./configure操作即可:
英特尔x86架构Mac
./configure --with-boost=/usr/local/opt/boost --with-boost-libdir=/usr/local/opt/boost/lib LIBS="-lboost_regex-mt"
苹果M系列架构Mac
./configure --with-boost=/opt/homebrew/opt/boost --with-boost-libdir=/opt/homebrew/opt/boost/lib LIBS="-lboost_regex-mt"
如果以上操作仍报错,可先导出路径变量后再执行配置:
# x86架构执行以下两行 export CPPFLAGS="-I/usr/local/opt/boost/include" export LDFLAGS="-L/usr/local/opt/boost/lib" # M系列架构执行以下两行 export CPPFLAGS="-I/opt/homebrew/opt/boost/include" export LDFLAGS="-L/opt/homebrew/opt/boost/lib" # 执行配置 ./configure LIBS="-lboost_regex-mt"
配置完成后确认输出显示checking for the Boost regex library... yes即可继续后续的make和make install操作,无需降级Boost版本。
内容的提问来源于stack exchange,提问作者Pavel Tetyaev
相关产品推荐
相关产品推荐

