<div dir="ltr">Hi Kevin, <div><br></div><div>Yes, those extra includes are there because some functions taken from the MASS package need these them.</div><div><br></div><div>I rearranged the includes by placing <span style="font-family:arial,sans-serif;font-size:13px">#include <RcppArmadillo.h> before the ones below, and was able to reduce the number of errors from 7 to 4. </span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">#include <R_ext/Linpack.h></span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">#include <R_ext/Applic.h></span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">#include <R_ext/Utils.h> </span><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font face="arial, sans-serif">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. </font></div>

<div><font face="arial, sans-serif"><br></font></div><div><a href="https://www.dropbox.com/s/ukjml693ta8r8gi/test2.cpp?dl=0">https://www.dropbox.com/s/ukjml693ta8r8gi/test2.cpp?dl=0</a><font face="arial, sans-serif"><br>
</font></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Thank you!!</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div>
<div class="gmail_extra">-Xiao</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 3, 2014 at 6:49 PM, Kevin Ushey <span dir="ltr"><<a href="mailto:kevinushey@gmail.com" target="_blank">kevinushey@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi Xiao,</span><br style="font-family:arial,sans-serif;font-size:13px">

<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">I can reproduce the error -- but why do you have the includes as such, e.g.:</span><br style="font-family:arial,sans-serif;font-size:13px">


<br style="font-family:arial,sans-serif;font-size:13px"><blockquote style="font-family:arial,sans-serif;font-size:13px;margin:0px 0px 0px 40px;border:none;padding:0px">#include <R.h><br>#include <float.h><br>

#include <R_ext/Linpack.h><br>
#include <R_ext/Applic.h> /* for the QR     routines */<br>#include <R_ext/Utils.h>  /* for the *sort() routines */<br>#include <stdio.h><br>#include <RcppArmadillo.h><br>#define BIG DBL_MAX<br></blockquote>


<br style="font-family:arial,sans-serif;font-size:13px"><div style="font-family:arial,sans-serif;font-size:13px">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).</div>


<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Cheers,</div><div style="font-family:arial,sans-serif;font-size:13px">Kevin</div></div>
</div></div></blockquote></div><br></div></div>