title: Undefined reference errors when including Rcpp.h
body: <p>I am using 64bit Ubuntu, and I am trying to write C++. </p>
  
  <p>I discovered if I use <code>#include &lt;Rcpp.h&gt;</code>, I don't even need to call any functions in the R namespace, and I would already receive undefired reference errors:</p>
  
  <pre><code>obj/x.o: In function `Rcpp::Rstreambuf&lt;true&gt;::xsputn(char const*, long)':
  /usr/local/lib/R/site-library/Rcpp/include/Rcpp/iostream/Rstreambuf.h:61: undefined reference to `Rprintf'
  obj/x.o: In function `Rcpp::Rstreambuf&lt;false&gt;::xsputn(char const*, long)':
  /usr/local/lib/R/site-library/Rcpp/include/Rcpp/iostream/Rstreambuf.h:65: undefined reference to `REprintf'
  obj/x.o: In function `Rcpp::Rstreambuf&lt;true&gt;::overflow(int)':
  /usr/local/lib/R/site-library/Rcpp/include/Rcpp/iostream/Rstreambuf.h:70: undefined reference to `Rprintf'
  obj/x.o: In function `Rcpp::Rstreambuf&lt;false&gt;::overflow(int)':
  /usr/local/lib/R/site-library/Rcpp/include/Rcpp/iostream/Rstreambuf.h:74: undefined reference to `REprintf'
  obj/x.o: In function `Rcpp::Rstreambuf&lt;true&gt;::sync()':
  /usr/local/lib/R/site-library/Rcpp/include/Rcpp/iostream/Rstreambuf.h:79: undefined reference to `R_FlushConsole'
  obj/x.o: In function `Rcpp::Rstreambuf&lt;false&gt;::sync()':
  /usr/local/lib/R/site-library/Rcpp/include/Rcpp/iostream/Rstreambuf.h:83: undefined reference to `R_FlushConsole'
  </code></pre>
  
  <p>I have installed r-base and r-base-dev. I installed Rcpp by running R as root and did a <code>install.package("Rcpp")</code></p>
  
  <p>I compile the C++ program using g++ with <code>-I/usr/local/lib/R/site-library/Rcpp/include</code> </p>
  
  <p>What am I missing here?  Thanks for any replies.</p>