Hi, I am developing a package where I would like to combine two Rcpp Attribute features: * Automatically providing a C++ interface * Renaming the exported function in R to contain a dot
My current attempts at doing so result in a run-time error. Steps to
reproduce:
* create an new package with Rcpp::Rcpp.package.skeleton()
* change src/rcpp_hello_world.cpp to rename the exported function and
create both R and C++ interfaces:
// [[Rcpp::interfaces(r, cpp)]]
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export(hello.world)]]
List rcpp_hello_world() {
CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
List z = List::create( x, y ) ;
return z ;
}
* build and install the package
* reference the function from C++:
// [[Rcpp::depends(anRpackage)]]
#include <Rcpp.h>
#include <anRpackage.h>
// [[Rcpp::export]]
Rcpp::List wrapper() {
return anRpackage::hello_world();
}
/*** R
wrapper()
*/
If I rename the function to 'hello_world', this compiles and runs fine.
If I rename the function to 'hello.world', it still compiles but fails
to run:
> wrapper()
Error in wrapper() :
Function not exported: C++ function with signature
'List(*hello_world)()' not found in anRpackage.
Is there a way to combine these two features?
Thanks
Ralf
--
Ralf Stubner
Senior Software Engineer / Trainer
daqana GmbH
Dortustraße 48
14467 Potsdam
T: +49 331 23 70 81 66
F: +49 331 23 70 81 67
M: +49 162 20 91 196
Mail: [email protected]
Sitz: Potsdam
Register: AG Potsdam HRB 27966 P
Ust.-IdNr.: DE300072622
Geschäftsführer: Prof. Dr. Dr. Karl-Kuno Kunze
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
