Ralf Stubner
2018-04-17 15:32:14 UTC
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
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: ***@daqana.com
Sitz: Potsdam
Register: AG Potsdam HRB 27966 P
Ust.-IdNr.: DE300072622
GeschÀftsfÌhrer: Prof. Dr. Dr. Karl-Kuno Kunze
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
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: ***@daqana.com
Sitz: Potsdam
Register: AG Potsdam HRB 27966 P
Ust.-IdNr.: DE300072622
GeschÀftsfÌhrer: Prof. Dr. Dr. Karl-Kuno Kunze