简体   繁体   中英

Cannot build cc-tools with Boost 1.76 on macOS got 'cannot find the flags to link with Boost regex' error

I'm trying to build cc-tool debugger as described herehttps://www.zigbee2mqtt.io/information/flashing_the_cc2531.html

But at configure step got this error

checking for the Boost regex library... no
configure: error: cannot find the flags to link with Boost regex

Same issue described here https://github.com/dashesy/cc-tool/issues/25 and suggested solution is to downgrade boost to 1.60. But it does not work anymore because 1.60 deleted from brew.

I've tried to use clang compiler instead of gcc but it does not work too.

MacOS: Big sur 11.5.2 (20G95)

Here the solution:

CC=/usr/bin/clang \
CXX=/usr/bin/clang++ \
CPPFLAGS=-I/usr/local/include \
LDFLAGS=-I/usr/local/include \
 ./bootstrap

CC=/usr/bin/clang \
CXX=/usr/bin/clang++ \
CPPFLAGS=-I/usr/local/include \
CXXFLAGS="-std=c++0x" \
LDFLAGS="-I/usr/local/include -lboost_system" \
LIBUSB_CFLAGS=-I/usr/local/include/libusb-1.0 \
LIBUSB_LIBS="-L/usr/local/lib -lusb-1.0" \
 ./configure

It allows to configure with boost 1.76. Found here https://gist.github.com/kidpixo/ef1a26ae953e3939a4eebe1b6fd2f07c

I've hit the very same issue, right today (same OS: MacOS 11.5.2).

I think one solution would be to create your own tap, with the Formula copied from the removed boost@1.60 (Homebrew/homebrew-core#84434).

For mac with M1 CPU, macOS Monterey (boost version 1.78.0):

CC=/usr/bin/clang \                          
CXX=/usr/bin/clang++ \
CPPFLAGS=-I/opt/homebrew/include \
LDFLAGS=-I/opt/homebrew/include \
 ./bootstrap

CC=/usr/bin/clang \
CXX=/usr/bin/clang++ \
CPPFLAGS=-I/opt/homebrew/include \
CXXFLAGS="-std=c++0x" \
LDFLAGS="-L/opt/homebrew/Cellar/boost/1.78.0_1/lib/" \
LIBUSB_CFLAGS=-I/opt/homebrew/include/libusb-1.0 \
LIBUSB_LIBS="-L/opt/homebrew/lib -lusb-1.0" \
 ./configure

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