[R] Rinternals.h and iostream don't play nice together'

Faheem Mitha faheem at email.unc.edu
Mon Jan 31 00:38:11 CET 2005



On Sun, 30 Jan 2005, Paul Roebuck wrote:

> and if you use the following instead of "Rinternals.h"?
> extern "C" {
> #include <Rdefines.h>
> }

Still the same errors. As Dirk pointed out, putting iostream first makes 
the errors go away in either case.

> 'Course I'm assuming you read that part in the 'R-exts.pdf' about using 
> C++ iostreams with R being best avoided? If you really need to do so 
> anyway, I'll give you a link to my iostream manipulator source that 
> interfaces with the R console. It handles the scenario described in 
> section 4.6 of above document but requires the GNU C++ compiler (g++) in 
> order to work though.

I'm just using iostreams for debugging purposes, not part of the code per 
se. Since I am trying to write an R wrapper for a prexisting C++ library, 
I already have print functions using iostreams, which I would prefer to 
reuse if possible. For my limited needs, iostreams works fine.

I also use g++, and would be interested in seeing your code in any case.

Thanks.                                                          Faheem.




More information about the R-help mailing list