You didn't attach the main.log, but the portion of it that you copied into the ticket description is enough to figure out that this is the familiar problem where you are using a C++20-capable compiler on a case-insensitive filesystem and the project you are trying to compile includes a VERSION file and it adds a -I
flag pointing to the directory containing the VERSION file which then conflicts with the C++20 "version" header. See https://bugs.llvm.org/show_bug.cgi?id=42540
It's an upstream issue that should be reported to and fixed by the developers of netcdf-cxx.
The best solution is for the project to change its build system so that a -I
flag for the directory containing the VERSION file is not added. Usually the VERSION file is in the top level directory and usually source files are in a subdirectory like "src" so adding an include path for the root directory isn't necessary. Often though projects by default write something like a config.h to the root directory, which causes the problem. If this is what's going on here, then the project can avoid the problem by writing config.h to a different directory.
An alternative is to move or rename the VERSION file, for example to VERSION.txt. If the VERSION file is referenced by other files, those references need to be updated.