In Mac OS I was getting an annoying warning when compiling Cpp code via Rcpp in R:

Adding a file called Makevars in ~/.R defining FLIBS to the actual location of gfortran in my machine fixed the problem. In my case, Makevars only contains the following line:

That’s it.