[Rcpp-devel] [R-pkg-devel] moving from C to C++ with Rcpp in R package

Jean Thioulouse jean.thioulouse at univ-lyon1.fr
Thu Jun 2 19:27:05 CEST 2022


But it seems that the C_ prefix must be added to _myPackage_myFunctionName (to get for example C__ade4_RVrandtestCpp) in the RcppExports.R file. So where should I modify the Rcpp::export tag ?

Thanks
Jean


> Le 2 juin 2022 à 15:49, Dirk Eddelbuettel <edd at debian.org> a écrit :
> 
> 
> On 2 June 2022 at 08:32, Dirk Eddelbuettel wrote:
> | 
> | (Removed CC to r-package-devel)
> | 
> | On 2 June 2022 at 16:24, Ivan Krylov wrote:
> | | Unfortunately, this means editing RcppExports.R, which (I think)
> | | prevents you from enjoying the way Rcpp::compileAttributes() sets
> | | everything up for you.
> | 
> | Yes. I think that is the best I came up with once too in a time of need in a
> | package actively mixing C and C++.  It simply is easier to have just C++, and
> | I think you generally can just convert your C files.
> 
> PS  One thing that works is to rename in the Rcpp::export tag ie
> 
>   // [[Rcpp::export(C_my_func_name)]]
> 
> can be used to prefix C_ to a function my_func_name().
> 
> Dirk
> 
> -- 
> dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
> _______________________________________________
> 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



More information about the Rcpp-devel mailing list