Re: [Rd] Interfacing R and C++

2006-01-09 Thread Sean Davis
On 1/9/06 3:20 PM, "Prof Brian Ripley" <[EMAIL PROTECTED]> 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 >

Re: [Rd] Interfacing R and C++

2006-01-09 Thread Prof Brian Ripley
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

[Rd] Interfacing R and C++

2006-01-09 Thread Sean Davis
I have a single c++ file that contains a class and a "wrapper" function that has C-like syntax for interacting with the Class. Basically, this wrapper function just makes an instance of the class and then organizes the data for return to R. #include void myFunc(double *data, int *n, double *p