 <p>How did you install R ? It looks like you are missing R headers. Perhaps you need to install the <a href="http://cran.r-project.org/bin/linux/debian/" rel="nofollow"><code>r-base-dev</code> package</a>. </p> <p>About the code, you don't need the wrapper. You can just put this in a <code>.cpp</code> file : </p> <pre><code>#include &lt;Rcpp.h&gt; using namespace Rcpp ; // [[Rcpp::export]] int fibonacci(const int x){ if(x == 0) return(0); if(x == 1) return(1); return(fibonacci(x - 1) + fibonacci(x - 2)); } </code></pre> <p>and just <code>sourceCpp</code> this file : </p> <pre><code>&gt; sourceCpp( "fib.cpp" ) &gt; fibonacci(6) [1] 8 </code></pre>