title: Linking Dynamic and Static Libraries Rcpp
body: <p>I am in the process of linking using a static library and dynamic library but, I run into this error:</p>
  
  <pre><code>/usr/bin/ld: ../src/SeqLib/bin//libseqlib.a(libseqlib_a-FermiAssembler.o): relocation R_X86_64_32S against `_ZNSs4_Rep20_S_empty_rep_storageE' can not be used when making a shared object; recompile with -fPIC
  </code></pre>
  
  <p>Here is how my Makevars file looks like:</p>
  
  <pre><code>( cd SeqLib; ./configure --enable-shared; make)
  PKG_CPPFLAGS= -I../src/SeqLib/ -I../src/SeqLib/fermi-lite/ -I../src/SeqLib/htslib/cram/ -I../src/SeqLib/htslib/htslib/ -I../src/SeqLib/htslib/ -I../src/SeqLib/bwa/
  PKG_LIBS=-fPIC -enable-shared-lib -L../src/SeqLib/bin/ -lbwa -lfml -lhts -lseqlib
  </code></pre>
  
  <p>I don't understand why I am getting this error when I included the <code>-fPIC</code> option in the <code>PKG_LIBS</code> variable. </p>