RcppArmadillo: Error when installing package on Mac
<p>I have an R package which I am trying to install on a MAC OS (yosemite), and I am getting a linker problem. This is the error that I am getting</p>

<pre><code>clang++ -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o File1.so File2.o File3.o File4.o RcppExports.o Utils.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation

ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mypackage.so] Error 1
ERROR: compilation failed for package ‘mypackage’
</code></pre>

<p>My <code>Makevars</code> file contain:</p>

<pre><code>PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
</code></pre>

<p>In <code>DESCRIPTION</code>, I have:</p>

<pre><code>Depends:
    R (&gt;= 3.2.0),
    Rcpp,
    RcppArmadillo
LinkingTo: Rcpp, RcppArmadillo
</code></pre>

<p>and in <code>R/help.R</code>, I have:</p>

<pre><code>#' @importFrom Rcpp evalCpp
#' @import RcppArmadillo
#' @useDynLib mypackage
NULL
</code></pre>

<p>This is not the same issue as this <a href="https://stackoverflow.com/questions/23767816/rcpp-error-usr-bin-ld-cannot-find-lgfortran">question</a> because I already included the Armadillo dependencies in the header file that is being indluced by the other <code>.cpp</code> files:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;algorithm&gt;
#include &lt;cmath&gt;
#include &lt;Rmath.h&gt;
#include &lt;RcppArmadillo.h&gt;

// [[Rcpp::depends(RcppArmadillo)]]
</code></pre>

<p>Am I missing something? Should the makefile be modified?</p>