[Rcpp-devel] Wierd compilation error
Romain François
romain at r-enthusiasts.com
Wed Jan 29 12:39:24 CET 2014
The attributes parser does not know how to handle the static keyword. Works for me without it.
You get the line number of the generated file. Use verbose = TRUE to have a better clue at what is wrong.
Romain
Le 29 janv. 2014 à 12:24, Alessandro Mammana <mammana at molgen.mpg.de> a écrit :
> 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!
> Ale
>
> --
> Alessandro Mammana, PhD Student
> Max Planck Institute for Molecular Genetics
> Ihnestraße 63-73
> D-14195 Berlin, Germany
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
More information about the Rcpp-devel
mailing list