title: Error when I call cpp function from another .cpp file
body: <p>I tried to call c++ function from another .cpp file. 
  I used .h header.
  See below what I did.</p>
  
  <p>I have a <strong>f.h</strong> file:</p>
  
  <pre><code>#ifndef PACKAGENAME_ADD_H
  #define PACKAGENAME_ADD_H
  
  #include &lt;Rcpp.h&gt;
  Rcpp::NumericVector f(Rcpp::NumericVector x) ;
  
  #endif
  </code></pre>
  
  <p><strong>f.cpp</strong> file:</p>
  
  <pre><code>#include &lt;Rcpp.h&gt;
  using namespace Rcpp;
  
  NumericVector f(NumericVector x) {
    return x * 2;
  }
  </code></pre>
  
  <p><strong>g.cpp</strong> file:</p>
  
  <pre><code>#include &lt;Rcpp.h&gt;
  #include &lt;f.h&gt;
  using namespace Rcpp;
  // [[Rcpp::export]]
  NumericVector g(NumericVector x) {
    return f(x);
  }
  </code></pre>
  
  <p>The three files are in the same folder I got this error when I run <strong>g.cpp</strong>:</p>
  
  <pre><code>Rcpp::sourceCpp('~/g.cpp')
  </code></pre>
  
  <blockquote>
    <p>Error in dyn.load("/tmp/Rtmpdu4AWp/sourceCpp-x86_64-pc-linux-gnu-0.12.17/sourcecpp_260f5e1a9ebc/sourceCpp_9.so") : 
      unable to load shared object '/tmp/Rtmpdu4AWp/sourceCpp-x86_64-pc-linux-gnu-0.12.17/sourcecpp_260f5e1a9ebc/sourceCpp_9.so':
      /tmp/Rtmpdu4AWp/sourceCpp-x86_64-pc-linux-gnu-0.12.17/sourcecpp_260f5e1a9ebc/sourceCpp_9.so: undefined symbol: _Z1fN4Rcpp6VectorILi14ENS_15PreserveStorageEEE</p>
  </blockquote>
  
  <p>Can someone help me?
  I work on ubuntu 18.04 and I have R 3.4.4 version.</p>