Rcpp attributes only work for global/free functions rather than class members. If you want to share clashes between packages the only good way to do it is header-only classes that you put in inst/include.<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 15, 2016 at 6:17 AM Charles Determan <<a href="mailto:cdetermanjr@gmail.com">cdetermanjr@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>Greetings,<br><br></div>I am trying to integrate some packages of mine so they can share some of the same C++ functions (not exposed to the R front-end user).  Here is my basic structure of the package I wish to export functions.<br><br></div>Class defined in header (foo.h) complete with all public and private members.<br><br></div>Members defined in cpp file (foo.cpp).<br></div>This is also where I thought I could use the Rcpp::interfaces(cpp) function generate the header file automatically (as I am not aware of a nice linking operation between multiple package .so files).  So each method is prefixed with //[[Rcpp::export]] for the package building.<br><br></div>I liked this approach because I wouldn't have to rewrite all my methods to the header file manually.  However, this doesn't appear to be working.  I am getting errors on the first method (I have tried only exporting one method and I get the same error).<br><br><br>In file included from ../inst/include/gpuR.h:7:0,<br>                 from RcppExports.cpp:4:<br>../inst/include/gpuR_RcppExports.h:28:20: error: expected unqualified-id before ‘<’ token<br>     inline template<typename T> dynEigenMat<T>::dynEigenMat(SEXP A_) {<br>                    ^<br>RcppExports.cpp:3313:1: error: expected ‘;’ at end of input<br> }<br> ^<br>RcppExports.cpp:3313:1: error: expected ‘}’ at end of input<br><br><br></div>Any insight would be appreciated.  Not sure if it is a problem with using the template methods or if this means I simply have a typo somewhere (I don't think so given that the code works without using the Rcpp interfaces attribute.<br><br></div>Regards,<br></div>Charles<br></div>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></blockquote></div>