[Rcpp-devel] RcppArmallilo can't work with Rdefines.h

Dirk Eddelbuettel edd at debian.org
Wed Jul 30 02:31:15 CEST 2014

On 29 July 2014 at 19:04, tony nwankwo wrote:
| Has anybody noticed that you can't compile arma:: code if you have Rdefines.h or Rinternals.h included in the source code???. Rcpp works just fine.

Rcpp already includes Rinternals.h, and does so _correctly_ by setting up
other defines as eg R_NO_REMAP.  

Quoting directly from RcppCommon.h:

// include R headers, but set R_NO_REMAP and access everything via Rf_ prefixes
#define MAXELTSIZE 8192
#define R_NO_REMAP
#include <R.h>
#include <Rinternals.h>
#include <R_ext/Complex.h>
#include <R_ext/Parse.h>
#include <R_ext/Rdynload.h>
#include <Rversion.h>

Just include <RcppArmadillo.h> and be done with it.  

It also include Rcpp.h and hence Rinternals.h. 

Rdefines.h is more optional and given the Rcpp API you should not need it.
If you must you can probably add it ...


http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the Rcpp-devel mailing list