From hin-tak.leung at cimr.cam.ac.uk  Mon Oct 17 19:28:11 2005
From: hin-tak.leung at cimr.cam.ac.uk (Hin-Tak Leung)
Date: Mon, 17 Oct 2005 18:28:11 +0100
Subject: [Rd] Embedded R in C
In-Reply-To: <737E15D6A012E24CAE3E82EF0403F07916FDB7A4@gmilp-p1.cdm.cm-cic.fr>
References: <737E15D6A012E24CAE3E82EF0403F07916FDB7A4@gmilp-p1.cdm.cm-cic.fr>
Message-ID: <4353DF2B.4040207@cimr.cam.ac.uk>

NGUYEN Truong Hoan wrote:
> 	Hello everyone,
> 
> 	I would like to call the R functions from the C++ language
> interface, for example from a program composed on Microsoft Visual C++.
> I have referred the manual Writing R Extensions but i don't understand
> exactly how to make a declaration for the headers Rinternals.h or R.h...

Section 7.2 and in particular, section 7.2.2. of R-ext manual has a
complete example for embedding R in C/C++ code under windows.
    7.2 Embedding R under Windows
    7.2.2 Calling R.dll directly
It looks fairly straight forward and alright to me?

(Granted, IMHO, the section is a bit hiddne and should be placed a
bit earlier and before that stuff in section 5
"The R API: entry points for C code".


HTL



[Rd] Embedded R in C
Hin-Tak Leung