As discussed over in Rcpp in RcppCore/Rcpp#1402 we are seeing some side effects from some package including R.h and later including possible also Rcpp.h and then RcppEigen.h leaving some of the masking of R's own error() function as Rf_error() to not be effective so that it later clashes with Eigen function error().
In general, it is always cleanest to just include RcppEigen.h as it does take care of both the others. For RcppArmadillo this once lead to issues to that it (very early on) switch to an actual compile error. We may do that one day but for now it might be a good idea to at least warn from RcppEigen.h if the header guards for either or both of Rcpp and R are seen.
As discussed over in Rcpp in RcppCore/Rcpp#1402 we are seeing some side effects from some package including
R.hand later including possible alsoRcpp.hand thenRcppEigen.hleaving some of the masking of R's ownerror()function asRf_error()to not be effective so that it later clashes with Eigen functionerror().In general, it is always cleanest to just include
RcppEigen.has it does take care of both the others. For RcppArmadillo this once lead to issues to that it (very early on) switch to an actual compile error. We may do that one day but for now it might be a good idea to at least warn fromRcppEigen.hif the header guards for either or both ofRcppandRare seen.