title: Rcpp cannot find gsl library
body: <p>im out of ideas</p>
  
  <p>Im trying to create a library for R, but i cant get it to load.</p>
  
  <p>The error im getting is</p>
  
  <pre><code>Error in dyn.load(file, DLLpath = DLLpath, ...) : 
    unable to load shared object '/home/stenver/R/x86_64-pc-linux-gnu-    library/2.15/RcppWilcoxonTest/libs/RcppWilcoxonTest.so':
    /home/stenver/R/x86_64-pc-linux-gnu-library/2.15/RcppWilcoxonTest/libs/RcppWilcoxonTest.so:     undefined symbol: gsl_cdf_gaussian_Q
  Error: loading failed
  </code></pre>
  
  <p>My Makevars file looks like this:</p>
  
  <pre><code>PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()" `
  </code></pre>
  
  <p>I have tried changing all kinds of stuff in there.</p>
  
  <p>My NAMESPACE file looks like this:</p>
  
  <pre><code>useDynLib(RcppWilcoxonTest)
  useDynLib(gsl)
  useDynLib(WilcoxonTest)
  
  import(Rcpp)
  
  export(RcppWilcoxonTest)
  </code></pre>
  
  <p>The failure happens in the dynamic shared library i am trying to use. I have copied the dynamic library files to the src folder, so R would compile them itself, but it is of no use. Ideally, i would like to keep the library and Rcpp interface implementation in a separate folders.</p>
  
  <p>At some point, i also tried to use RcppGSL, but it didnt help, as R couldnt find the package after install.</p>
  
  <p>The entire repository can be seen here:</p>
  
  <p><a href="https://bitbucket.org/stenver/wilxoni-astaku-test/src/8c9b5da2cd9a97fd6c1a569e468c50ca95e2e06f?at=default" rel="nofollow">https://bitbucket.org/stenver/wilxoni-astaku-test/src/8c9b5da2cd9a97fd6c1a569e468c50ca95e2e06f?at=default</a></p>
  
  <p>in the RcppWilcoxonTest folder</p>