Skip to content
Prev 5719 / 10988 Next

[Rcpp-devel] Question about custom as and wrap functions

Hello Finlay,

I believe that I ran into a similar problem a few weeks ago.  Maybe you can
find it on the recent archive of the list.  I was having a similar issue
with RcppExports.cpp not compiling because it couldn't recognize a type.

What ended up working for me was to use the RcppAttributes 'interface'
functionality.  It's described in section 3.5 of the RcppAttributes
vignette.  By adding '// [[Rcpp::interfaces(r, cpp)]]' to one of your .cpp
source files Rcpp will automatically build the header (named after the
package) that JJ was alluding to and then you can manually modify it to
include the other headers that you need.  By deleting the auto-generated
key at the top of the 'asWrapExample.h' header (in your case) Rcpp won't
re-generate it and it is automatically included in RcppExports.cpp, along
with your specialized headers required for your package.

I don't know why just manually creating it yourself like JJ suggested and
what you seem to do didn't work, but maybe going through the package's
auto-generation stuff will.

Hope that helps,

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130425/826a433c/attachment-0001.html>