<div dir="ltr">Thank you for that clarification, I always seem to forget that Rcpp packages have many libraries loaded by default.  I have trimmed the headers down to the following to just <div><br></div><div>#include <RcppArmadillo></div><div><br></div><div>However, some further background, I am working on extending the bigalgebra package (hence the interest in RcppArmadillo) so their are some additional headers that are now included in this problem.  The total headers now looks like this:</div><div><br></div><div>#include "bigmemory/BigMatrix.h"</div><div><br></div><div><div>#include <RcppArmadillo.h></div></div><div><br></div><div>#ifdef REFBLAS</div><div>#include "refblas64longlong.h"</div><div>#define INT long long</div><div>#else</div><div>#include <R_ext/BLAS.h></div><div>#include <R_ext/Lapack.h></div><div>#define INT int</div><div>#endif</div><div><br></div><div>Again, if I simply change RcppArmadillo to Rcpp it compiles without a problem but with RcppArmadillo more of the 'length passed 4 arguments' and also 'const string has no member name 'Rf_length' errors.</div><div><br></div><div>Thanks again,</div><div>Charles</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 24, 2015 at 1:06 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</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"><br>
On 24 February 2015 at 12:30, Charles Determan Jr wrote:<br>
| Greetings,<br>
|<br>
| I have run in to an error when compiling an R package that has the following<br>
| headers in the only cpp file at the moment:<br>
|<br>
| #include <string><br>
| #include <iostream><br>
| #include <cmath><br>
|<br>
| #define R_NO_REMAP<br>
|<br>
| #include <R.h><br>
| #include <Rinternals.h><br>
| #include <Rdefines.h><br>
|<br>
| Now, I am also trying to use RcppArmadillo with:<br>
|<br>
| #include <RcppArmadillo.h><br>
| // [[Rcpp::depends(RcppArmadillo)]<br>
|<br>
| However, when I try and build the package, it errors out with a bunch of errors<br>
| such as:<br>
|<br>
| /usr/include/c++/4.8/bits/fstream.tcc:824:60: error: macro "length" passed 4<br>
| arguments, but takes just 1<br>
|<br>
| which is repeated multiple times on different lines.  I haven't included the<br>
| entire output as it is rather lengthly but could provide if it would help<br>
| further.  I tried searching for help but the closest I found was this previous<br>
| post (<a href="http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2013-February/" target="_blank">http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2013-February/</a><br>
| 005325.html) but the R_NO_REMAP hasn't helped here.  I suspect something must<br>
| be conflicted between the R headers and RcppArmadillo because it works just<br>
| fine if I only use Rcpp.h (but I want to use RcppArmadillo).  Any thoughts?<br>
<br>
</div></div>I definitely have fought this too way back when.  I think we generally do the<br>
right thing now as it no longer "spills" out of Rcpp proper.<br>
<br>
You do have a bit of a mess here with headers:<br>
<br>
  a) you may not need all of string, iostream, cmath; I think we include some<br>
    (all?) of these.  You may need just iostream<br>
<br>
  b) you do not need R.h; you probably do not need the others<br>
<br>
  c) just RcppArmadillo is good and often self-sufficient<br>
<br>
so I would quickly restart from the inside out with just RcppArmadillo.h and<br>
then add code paragraph by paragraph and judiciously only add the headers you<br>
need.<br>
<span class="HOEnZb"><font color="#888888"><br>
Dirk<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Dr. Charles Determan, PhD<br>Integrated Biosciences<br></div></div>
</div>