title: Compiler Error in Rcpp: "fatal error: stdlib.h: No such file or directory #include_next <stdlib.h>"
body: <p>I have updated Xcode and MacOS operating system to Monterey and now I am having a series of issues of making Rstudio to work as used to do.</p>
  <p>In particular, now I am getting an error when I try to source with <code>Rcpp</code> the code described in <a href="https://stackoverflow.com/questions/42262963/rcpp-with-quad-precision-computation/42307240#42307240">Rcpp with quad precision computation</a>.</p>
  <p>This is the error I get:</p>
  <pre><code>In file included from /usr/local/gfortran/include/c++/12.1.0/cmath:47,
                   from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:100,
                   from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include/Rcpp/r/headers.h:62,
                   from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include/RcppCommon.h:30,
                   from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include/Rcpp.h:27,
                   from quadexp.cpp:2:
  /usr/local/gfortran/include/c++/12.1.0/bits/std_abs.h:38:15: fatal error: stdlib.h: No such file or directory
     38 | #include_next &lt;stdlib.h&gt;
        |               ^~~~~~~~~~
  compilation terminated.
  make: *** [quadexp.o] Error 1
  </code></pre>
  <p>Do you have any idea of what does it mean? I checked in <code>/usr/local/gfortran/include/c++/12.1.0/bits</code> and <code>stdlib.h</code> is present.</p>
  <p>This is my <code>~/.R/Makevars</code>:</p>
  <pre><code>LOC=/usr/local/gfortran
  CC=$(LOC)/bin/gcc -fopenmp
  CXX=$(LOC)/bin/g++ -fopenmp
  CXX11 = $(LOC)/bin/g++ -fopenmp
  
  CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
  CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe -I/usr/local/opt/llvm/include
  LDFLAGS=-L$(LOC)/lib -Wl,-rpath,$(LOC)/lib,-L/usr/local/lib
  CPPFLAGS=-I$(LOC)/include -I/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/usr/local/include 
  
  FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
  CXX1X=/usr/local/gfortran/bin/g++
  CXX98=/usr/local/gfortran/bin/g++
  CXX11=/usr/local/gfortran/bin/g++
  CXX14=/usr/local/gfortran/bin/g++
  CXX17=/usr/local/gfortran/bin/g++
  </code></pre>