'Trouble compiling via Rcpp - headers not recognized?

I just finished re-installing both Xcode and CLT on my Mac running Big Sur 11.4. I'm working in RStudio Version 1.4.1717 with R 4.1.1

I then ran devtools::has_devel() to ensure things were installed properly and they weren't. I received the message

Error: Could not find tools necessary to compile a package

Call pkgbuild::check_build_tools(debug = TRUE) to diagnose the problem.

To fix the problem, I deleted my Makevars and now everything is OK.

Your system is ready to build packages!

However, upon attempting to build(), compilation fails and R throws several errors.

Here is one such error

  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/Mac  OSX.sdk/usr/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global   namespace
using ::signbit;
      ~~^

It seems that Rcpp is not being recognized? Maybe the C++ headers...

I found this SO post, but it concerns Mac OS Catalina: Catalina C++: Using <cmath> headers yield error: no member named 'signbit' in the global namespace

Any thoughts on how to solve?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source