Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

build

boost

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)

like image 252
Pavel Tetyaev Avatar asked Sep 07 '21 06:09

Pavel Tetyaev


People also ask

What is the static version of a boost DLL?

This convention distinguishes the static version of a Boost library from the import library for an identically-configured Boost DLL, which would otherwise have the same name. These libraries were compiled without optimization or inlining, with full debug symbols enabled, and without NDEBUG #define d.

How do I build boost from source with Visual C++?

If you want to use any of the separately-compiled Boost libraries, you'll need to acquire library binaries. If you wish to build from source with Visual C++, you can use a simple build procedure described in this section. Open the command prompt and change your current directory to the Boost root directory.

Where can I find the boost root directory?

It's important to note the following: The path to the boost root directory (often C:\Program Files\boost\boost_1_76_0) is sometimes referred to as $BOOST_ROOT in documentation and mailing lists . To compile anything in Boost, you need a directory containing the boost\ subdirectory in your #include path.

Why is the boost website version of this Getting Started Guide different?

The Boost website version of this Getting Started guide may have updated information, such as the location of additional installers or improved installation procedures, so you might want use that version if you've got an Internet connection available. Welcome to the Boost libraries!


2 Answers

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

like image 63
Pavel Tetyaev Avatar answered Oct 10 '22 04:10

Pavel Tetyaev


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
like image 2
IgorL Avatar answered Oct 10 '22 06:10

IgorL