On Sun, 30 Jan 2005, Dirk Eddelbuettel wrote:
On 30 January 2005 at 18:03, Faheem Mitha wrote: | Consider the following file. | | ******************************* | foo.cc | ******************************* | #include <R.h> | #include <Rinternals.h> | #include <iostream> | ******************************* | | R CMD SHLIB foo.cc
Two changes are required: You absolutely do need extern "C" ... to get C headers in with C++, and the other is a simple reordering -- not sure where I learned that can help at times ...
[EMAIL PROTECTED]:/tmp> cat foo.cc #include <iostream> extern "C" { #include <R.h> #include <Rinternals.h> }
Ok, but R.h and Rinternals.h are already wrapped in extern "C", as you can check, so this is superfluous.
I've verified that putting iostream first fixes this, but this is really a workaround, though still useful for me.
Thanks. Faheem.
______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
