You did not say how you attempted to compile your function. It matters:
In a package, use
LinkingTo: RcppEigen
.In a function used with Rcpp Attributes, use a proper
Rcpp::depends(RcppEigen)
.
There are numerous examples here, at the Rcpp Gallery and other places. Follow them, but follow all steps. Right now you have the compiler telling you that RcppEigen
is unknown.
My Rcpp book details build issues in Chapter 2.