Hi Kevin,

Yes, those extra includes are there because some functions taken from the
MASS package need these them.

I rearranged the includes by placing #include <RcppArmadillo.h> before the
ones below, and was able to reduce the number of errors from 7 to 4.

#include <R_ext/Linpack.h>
#include <R_ext/Applic.h>
#include <R_ext/Utils.h>

Is it possible for you to take a look at the script below, which includes
those functions from MASS that require these includes? I am not sure what
else needs to be done. The errors seem to have to do with the fortran
library.

https://www.dropbox.com/s/ukjml693ta8r8gi/test2.cpp?dl=0

Thank you!!


-Xiao



On Wed, Sep 3, 2014 at 6:49 PM, Kevin Ushey <kevinus...@gmail.com> wrote:

> Hi Xiao,
>
> I can reproduce the error -- but why do you have the includes as such,
> e.g.:
>
> #include <R.h>
> #include <float.h>
> #include <R_ext/Linpack.h>
> #include <R_ext/Applic.h> /* for the QR     routines */
> #include <R_ext/Utils.h>  /* for the *sort() routines */
> #include <stdio.h>
> #include <RcppArmadillo.h>
> #define BIG DBL_MAX
>
>
> My best guess is that you'll have to re-organize the includes, or put in
> some corresponding `#define` and `#undef`s to clean up some macro pollution
> that seems to be leaking out. Note that the file compiles successfully if
> you just include RcppArmadillo (but presumedly, in a real example, you want
> things from the other headers).
>
> Cheers,
> Kevin
>
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to