Pavel Tetyaev
Pavel Tetyaev

Reputation: 451

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 here https://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)

Upvotes: 11

Views: 1298

Answers (3)

IgorL
IgorL

Reputation: 1169

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

Upvotes: 4

Pavel Tetyaev
Pavel Tetyaev

Reputation: 451

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

Upvotes: 24

Leo
Leo

Reputation: 1

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 [email protected] (Homebrew/homebrew-core#84434).

Upvotes: 0

Related Questions