Hi,

This has to be a basic question, but I cannot figure out what I am missing nor 
see quite similar pre-existing posts.

I am trying to create an Rcpp module around a class (generated C++ proxy 
class). The environment is Rcpp 0.10.5 on Windows, R 3.0.2 x64 and RTools 3.0.

R CMD INSTALL spits the dummy at compilation(?) time when the Exporter things 
kick in, with the message " cannot convert 'SEXP' to 'const 
std::vector<double>*' in initialization" on the 'Play' method as per below.

class SimulationExport {
public:
  SimulationExport();
  ~SimulationExport();
  void Execute(void);
  void Play(const char* name, const std::vector<double>* values);
// other methods snipped
}

RCPP_MODULE(SimulationEx){
    class_<SimulationExport>( "Simulation" )
// snipped
    .method( "play", &SimulationExport::Play)
// snipped
}

I don't get why it cannot wrap a vector<double> given how similar it is to 
"7.2.2.7 Full Example" in the " Seamless R and C++ Integration with Rcpp" book. 
The same sample code created with Rcpp.package.skeleton compiles (though it 
fails check on load, BTW). The only difference is the presence of a 'const' 
modifier before the vector, but removing it does not solve the issue.

Rcpp.package.skeleton('sampleRcpp', module=TRUE, author='J-M')
library(devtools)
check('sampleRcpp') # passes past the compilation step.

Cheers,
J-M
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to