This has happened several times when trying to install certain R packages in my M1 mac (Sonorama 14.5).
The first error I am getting is this:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:321:5: error: tried including <math.h> but didn’t find libc++’s <math.h> header. This usually means that your header search paths are not configured properly. The header search paths should contain the C++ Standard Library headers before any C Standard Library, and you are probably using compiler flags that make that not be the case.
So, it seems that I have to configure those search paths. Problem is, I have not the foggiest idea how to do that. The math.h is indeed included in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/
I have been checking around to understand the error. I am not sure if this is the case, but for what I gathered, every time CommandLineTools gets updated it changes paths.
Any hand at this would be much appreciated.
I hope this question contains all the info, otherwise, let me know if there is more needed to solve the issue.
Thank you!