title: RcppTN .cpp script works when sourced but not when compiled in library
body: <p>I am trying to create a R package that uses random draws from a truncated normal in a .cpp script. I am using the rtn1 function from the pckage RcppTN. If I source the code, the function works fine. Once I build the package I get the error:</p>
  
  <pre><code>&gt; library(testtruncnorm)
  &gt; testtruncnorm()
  Error in testtruncnorm::testtruncnorm() :
    function 'RcppTN_rtn1' not provided by package 'RcppTN'
  </code></pre>
  
  <p>Simplified .cpp code is here</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;RcppArmadillo.h&gt;
  // [[Rcpp::depends(RcppArmadillo)]]
  #include &lt;RcppTN.h&gt;
  // [[Rcpp::depends(RcppTN)]]
  #include&lt;armadillo&gt;
  using namespace Rcpp;
  
  //' draw truncated normal
  //'
  //' testtruncnorm() 
  //' @return returns 2 draws from a truncated normal
  // [[Rcpp::export]]
  arma::vec testtruncnorm()
  {
    arma::vec result = arma::ones(2);
    result[1] = RcppTN::rtn1(1, 1, 0,HUGE_VAL);
    result[2] = RcppTN::rtn1(1, 1, 0,HUGE_VAL);
  
    return result; 
   }
  </code></pre>
  
  <p>My NAMESPACE file is </p>
  
  <pre><code>useDynLib(testtruncnorm, .registration=TRUE)
  importFrom(Rcpp, evalCpp)
  exportPattern("^[[:alpha:]]+")
  </code></pre>
  
  <p>My DESCRIPTION file is</p>
  
  <pre><code>Package: testtruncnorm
  Type: Package
  Title: What the Package Does Using Title Case
  Version: 1.0
  Date: 2018-10-23
  Author: Your Name
  Maintainer: Your Name &lt;your@email.com&gt;
  Description: More details about what the package does. See
       &lt;http://cran.r-project.org/doc/manuals/r-release/R-exts.html#The- 
  DESCRIPTION-file&gt;
       for details on how to write this part.
  License: GPL (&gt;= 2)
  Imports: Rcpp (&gt;= 0.12.19), RcppTN
  LinkingTo: Rcpp, RcppArmadillo, RcppTN
  </code></pre>
  
  <p>I am using RStudio create "R Package with RcppArmadillo" to get started. RStudio version 1.1.456. R version 3.5.1. Windows 10.</p>