[Rcpp-devel] inline error

Hadley Wickham h.wickham at gmail.com
Mon Oct 28 17:05:24 CET 2013


FYI, that's equivalent to the somewhat cleaner

library(Rcpp)
cppFunction("NumericVector x(NumericVector start) {
  return 1;
}")

Hadley

On Mon, Oct 28, 2013 at 8:58 AM, Simon Zehnder <szehnder at uni-bonn.de> wrote:
> 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



-- 
Chief Scientist, RStudio
http://had.co.nz/


More information about the Rcpp-devel mailing list