[Rcpp-devel] inline error

Wray, Christopher christopher.wray.10 at ucl.ac.uk
Mon Oct 28 15:15:55 CET 2013


Its just a typo on plugin (no s). And scope Rcpp::wrap.

cfunc <- cxxfunction( signature(start="vector"), body = 'Rcpp::NumericVector x(start); return Rcpp::wrap(1);', plugin = "Rcpp" )

extra 's' on parameter plugins

or

cfunc <- cxxfunction( signature(start="vector"), body = 'using namespace Rcpp; NumericVector x(start); return wrap(1);', plugin = "Rcpp" )

both work.
________________________________________
From: rcpp-devel-bounces at lists.r-forge.r-project.org <rcpp-devel-bounces at lists.r-forge.r-project.org> on behalf of Simon Zehnder <szehnder at uni-bonn.de>
Sent: 28 October 2013 13:58
To: rcpp-devel at lists.r-forge.r-project.org
Subject: [Rcpp-devel] inline error

Dear Rcpp::Users and Rcpp::Devels,

I get a weird error when using inline and I want to know, where it comes from. I run the following code:

library(Rcpp)
library(inline)
cfunc <- cxxfunction(signature(start="vector"), body = "Rcpp::NumericVector x(start); return 1;", plugins = "Rcpp”)

And I get the following Error:

Error in compileCode(f, code, language = language, verbose = verbose) :
  Compilation ERROR, function(s)/method(s) not created! file1606062c0507.cpp: In function ‘SEXPREC* file1606062c0507(SEXP)’:
file1606062c0507.cpp:19:1: error: ‘Rcpp’ has not been declared
 Rcpp::NumericVector x(start); return 1;
 ^
file1606062c0507.cpp:19:21: error: expected ‘;’ before ‘x’
 Rcpp::NumericVector x(start); return 1;
                     ^
file1606062c0507.cpp:19:38: error: invalid conversion from ‘int’ to ‘SEXP’ [-fpermissive]
 Rcpp::NumericVector x(start); return 1;
                                      ^
make: *** [file1606062c0507.o] Error 1
In addition: Warning message:
running command '/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file1606062c0507.cpp 2> file1606062c0507.cpp.err.txt' had status 1

Best
Simon

_______________________________________________
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