There are a few things that could be wrong. Primarily, you do need to modify the DESCRIPTION
file to include LinkingTo: Rcpp, RcppArmadillo
and ensure that #include <RcppArmadillo.h>
is present in each .cpp
file in the /src
directory. You will also need to include two Makevars
files.
Makevars.win
and Makevars
with:
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
For a complete walkthrough of setting up RStudio to use RcppArmadillo as a package please see:
http://thecoatlessprofessor.com/programming/setting-up-rstudio-to-work-with-rcpparmadillo/
solved Moving from sourceCpp to a package with RcppArmadillo