compileAttributes puts Rcpp.h before the package header file in RcppExports.cpp.
When I modernized RcppArmadillo to use attributes, I had this:
In file included from RcppExports.cpp:5:
./../inst/include/RcppArmadillo.h:27:6: error: "The file 'Rcpp.h' should not be included. Please correct to include only 'RcppArmadillo.h'."
#error "The file 'Rcpp.h' should not be included. Please correct to include only 'RcppArmadillo.h'."
^
So for now, I have manually edited the [RcppExports.cpp](https://github.com/RcppCore/RcppArmadillo/blob/master/src/RcppExports.cpp#L4] file to flip the order.
@jjallaire I was wondering if we could include the package header file first. Chances are people include Rcpp.h in there anyway.
compileAttributesputsRcpp.hbefore the package header file inRcppExports.cpp.When I modernized
RcppArmadilloto use attributes, I had this:So for now, I have manually edited the [RcppExports.cpp](https://github.com/RcppCore/RcppArmadillo/blob/master/src/RcppExports.cpp#L4] file to flip the order.
@jjallaire I was wondering if we could include the package header file first. Chances are people include
Rcpp.hin there anyway.