what's wrong with my plugin for inline::cxxfunction()?

74 Views Asked by At

I can run some example code from inline::cxxfunction()'s documentation:

inline::cxxfunction(signature(x = "integer", y = "numeric"), 
            "return wrap( as<int>(x) * as<double>(y));",
            plugin = "Rcpp" )

and that works, but the minute I try to use my plugin,

inline::cxxfunction(signature(x = "integer", y = "numeric"), 
                    "return wrap( as<int>(x) * as<double>(y));",
                    plugin = "pfr" )

it doesn't. I get the error

Error in compileCode(f, code, language = language, verbose = verbose) : 
  file59cc7af8325c.cpp:11:1: error: ‘SEXP’ does not name a type   11 | SEXP file59cc7af8325c( SEXP x, SEXP y) ;      | ^~~~file59cc7af8325c.cpp:15:1: error: ‘SEXP’ does not name a type   15 | SEXP file59cc7af8325c(SEXP x, SEXP y) {      | ^~~~make: *** [/usr/lib/R/etc/Makeconf:177: file59cc7af8325c.o] Error 1

Here's my plugin's output:

$includes
[1] "// [[Rcpp::plugins(cpp14)]]\n"

$body
function(x) x
<bytecode: 0x5601b7f4bb88>
<environment: 0x5601bb0a5140>

$env
$env$PKG_CPPFLAGS
[1] "  -I\"/home/trb5me_admin/pfr/inst/include/\"  -I\"/home/trb5me_admin/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include/\"  -I\"/home/trb5me_admin/R/x86_64-pc-linux-gnu-library/4.2/RcppEigen/include/\"  -I\"/home/trb5me_admin/R/x86_64-pc-linux-gnu-library/4.2/RcppEigen/include/unsupported\"  -DEIGEN_NO_DEBUG  -DDROPPINGTHISINRPACKAGE "


$LinkingTo
[1] "RcppEigen" "Rcpp"     

$Depends
[1] "RcppEigen" "Rcpp"     

$Imports
[1] "RcppEigen" "Rcpp"
0

There are 0 best solutions below