[Rcpp-devel] error: expected unqualified-id before string constant
jj.allaire at gmail.com
Sun Feb 24 16:41:55 CET 2013
> I presume that the Rcpp-attributes vignette never ever shows RcppExport,
> JJ probably did not assume it could be used.
> And it "really" is just an alias for the uglier-looking 'extern "C"'. And
> course added by the very layers that sourceCpp() puts around the code you
> give it... so you are pretty much expected not to put it there. Does using
> verbose=TRUE help / give any hints?
> In my mind, the way to think about this is that sourceCpp() will compile
> link the __C++ interface__ functions you give and provice __.Call()
> by building wrappers. You stuck something for the latter onto the former,
> things broke and you got to keep the pieces.
Yes, extern "C" aka the RcppExport macro has no place here. That's a macro
for use at the outer level of interop with R (which is taken care of for
you by sourceCpp). If you do as Dirk mentioned and specify verbose=TRUE
then you'll see that the stubs we generate from sourceCpp actually make
direct use of the RcppExport macro.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rcpp-devel