[Rd] Interfacing R and C++

Sean Davis sdavis2 at mail.nih.gov
Mon Jan 9 21:27:28 CET 2006




On 1/9/06 3:20 PM, "Prof Brian Ripley" <ripley at stats.ox.ac.uk> wrote:

> The wrapper function must be in extern "C" {} since you want to give it a
> C name (and not a mangled C++ one).  These days, the headers probably do
> not need to be, but in theory if they are C headers they should be in any
> C++ code.
> 
> I think R-exts is quite clear on this:
> 
>    To use with @R{}, the only thing we have to do is writing a wrapper
>    function and ensuring that the function is enclosed in
>                               ^^^^^^^^^^^^^^^^^^^^^^^^

Yes, the documentation is clear, provided one knows what name-mangling is
and why it is important, which I now understand better.

Thanks,
Sean



More information about the R-devel mailing list