[Rcpp-devel] Wierd compilation error

Alessandro Mammana mammana at molgen.mpg.de
Wed Jan 29 12:24:23 CET 2014

Hi all,
I was experimenting with templates and Rcpp and trying to compile this code:

// [[Rcpp::export]]
static void readVector(Vector<INTSXP> v){
    traits::storage_type<INTSXP>::type i = v[0];
    Rcout << i << std::endl;

I got this error:

scratchpad.cpp: In function 'SEXPREC* sourceCpp_3062_readVector(SEXP)':
scratchpad.cpp:337:21: error: variable or field '__result' declared void
scratchpad.cpp:338:9: error: '__result' was not declared in this scope
make: *** [scratchpad.o] Error 1

Also, the line numbers don't make any sense, because the file
scratchpad.cpp is only 250 lines long...

Do you know what could be wrong?

Thanks in advance!

Alessandro Mammana, PhD Student
Max Planck Institute for Molecular Genetics
Ihnestraße 63-73
D-14195 Berlin, Germany

More information about the Rcpp-devel mailing list