Make sure that Boost Filesystem is installed. On Debian-based distros and Ubuntu, you install libboost-filesystem-dev and libboost-dev from apt. On Red Hat/CentOS/Fedora it's boost-filesystem and boost-devel from yum/dnf.
On brew I believe that these files are located in the
boost package. I don't see any listing of boost-filesystem when browsing
https://formulae.brew.sh/formula/.
You may end up having to build Boost yourself since brew doesn't seem to have the package.