title: fatal error: RcppEigen.h: No such file or directory
body: <p>I am very new to <code>Rcpp</code> and <code>RcppEigen</code> probably this is why i can not figute it out myself:</p>
  
  <p>I just want to write a c++ function that includes the Eigen library. To test if it workes i took the following example from <a href="http://people.math.aau.dk/~sorenh/misc/Rdocs/Rcpp/RcppSHLIB.pdf" rel="nofollow">http://people.math.aau.dk/~sorenh/misc/Rdocs/Rcpp/RcppSHLIB.pdf</a>:</p>
  
  <pre><code>#include &lt;Rcpp.h&gt;
  #include &lt;RcppEigen.h&gt;
  RcppExport SEXP C_spdinv_eigen ( SEXP X_ ){
  using Eigen::Map;
  using Eigen::MatrixXd;
  typedef Eigen::Map&lt;Eigen::MatrixXd&gt; MapMatd;
  const MapMatd X(Rcpp::as&lt;MapMatd&gt;(X_));
  const MatrixXd Xinv(X.inverse());
  return(Rcpp::wrap(Xinv));
  }
  </code></pre>
  
  <p>But i get the following error:</p>
  
  <pre><code>rcpp-test.cpp:2:23: fatal error: RcppEigen.h: No such file or directory
  compilation terminated.
  make: *** [rcpp-test.o] Error 1
  g++ -I/usr/share/R/include -DNDEBUG    -I"/usr/local/lib/R/site-library/Rcpp/include"    -fpic  -O3 -pipe  -g  -c rcpp-test.cpp -o rcpp-test.o 
  Error in Rcpp::sourceCpp("rcpp-test.cpp") : 
    Error 1 occurred building shared library.
  </code></pre>
  
  <p>Compiling a script that only has the <code>#include &lt;Rcpp.h&gt;</code> is working perfectly.
  The <code>RcppEigen.h</code>-file in located in the <code>/usr/local/lib/R/site-library/RcppEigen/include</code> directory. I tried installing <code>RcppEigen</code> with <code>R CMD INSTALL ...</code> and <code>install.package</code>: neither worked.</p>
  
  <p>My seccionInfo is</p>
  
  <pre><code>R version 3.0.2 (2013-09-25)
  Platform: x86_64-pc-linux-gnu (64-bit)
  
  locale:
   [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C         LC_TIME=C            LC_COLLATE=C         LC_MONETARY=C       
   [6] LC_MESSAGES=C        LC_PAPER=C           LC_NAME=C            LC_ADDRESS=C         LC_TELEPHONE=C      
  [11] LC_MEASUREMENT=C     LC_IDENTIFICATION=C 
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] RcppEigen_0.3.2.1.1 Rcpp_0.11.1        
  
  loaded via a namespace (and not attached):
  [1] Matrix_1.1-1.1  grid_3.0.2      lattice_0.20-27 tools_3.0.2    
  </code></pre>
  
  <p>Thanks for any help!</p>