[Rcpp-devel] Request for help with compiling Rcpp example

Slava Razbash slava.razbash at gmail.com
Thu Oct 13 07:16:48 CEST 2011


I am trying to compile the example program with "inline" from the
jstatsoft article by Eddelbuettel and Francois (2011). I am using
WinXP and R 2.13.2 and RCPP 0.9.7. I am using Rtools 2.14.

My code:
 src <- '
  Rcpp::NumericVector xa(a);
  Rcpp::NumericVector xb(b);
  int n_xa = xa.size(), n_xb = xb.size();

  Rcpp::NumericVector xab(n_xa + n_xb - 1);
  for (int i = 0; i < n_xa; i++)
  for (int j = 0; j < n_xb; j++)
  xab[i + j] += xa[i] * xb[j];
  return xab;
  '

fun <- cxxfunction(signature(a = "numeric", b = "numeric"),src, plugin
= "Rcpp", verbose=TRUE)

The error messages that I get:

Compilation argument:
 C:/R/R-2.13.2/bin/i386/R CMD SHLIB file44d370a0.cpp 2>
file44d370a0.cpp.err.txt

ERROR(s) during compilation: source code errors or compiler
configuration errors!


Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created!

In addition: Warning message:
running command 'C:/R/R-2.13.2/bin/i386/R CMD SHLIB file44d370a0.cpp
2> file44d370a0.cpp.err.txt' had status 1


My question:
If an error file is actually being written, where do i find it?
Is this a common error where perhaps you can already see the problem?

Thank you,

Slava


More information about the Rcpp-devel mailing list