rdfind fails to build with modern C++20-compatible compilers on macOS. The error is:
In file included from Checksum.cc:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/array:112:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/__tuple:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/cstddef:37:
./version:1:1: error: expected unqualified-id
1.4.1
^
We have seen this problem in several other software packages. This happens because of this combination of factors:
C++20 introduced a new standard header called version which some other standard headers include.
macOS filesystems are by default case-insensitive.
Your project has a file called VERSION in its root directory.
Your project uses the preprocessor flag -I. to add the root directory to the include path.
Solutions to the issue are:
Don't add the root directory to the include path. Don't put files in the root directory that need to be included. Autoconf likes to put a generated config.h file into the root directory, but you can tell it to be elsewhere, such as in a subdirectory. I see your source files are also in the root directory; they could be moved to a subdirectory like src. Or:
Don't have a file called VERSION in the root directory; call it for example VERSION.txt instead.
rdfind fails to build with modern C++20-compatible compilers on macOS. The error is:
This was reported to MacPorts here: https://trac.macports.org/ticket/63322
We have seen this problem in several other software packages. This happens because of this combination of factors:
version
which some other standard headers include.VERSION
in its root directory.-I.
to add the root directory to the include path.Solutions to the issue are:
src
. Or:VERSION
in the root directory; call it for exampleVERSION.txt
instead.