To enable Rcpp debugging, as part of an answer on old Rcpp listserv Romain suggested:
"Maybe you can enable some rcpp debugging by adding
#define RCPP_DEBUG_LEVEL 1
Before you include Rcpp.h, this will give you verbose output, maybe this will help locating the issue. "