On Sat, Jun 6, 2009 at 5:31 PM, Dirk Eddelbuettel wrote:
>
> Try reading 'R Extensions' section 8.1 entitled 'Embedding R under
> Unix-alikes'.
That was just what I needed! All it took was adding a single line before
the call to mkString (and adding one more header file):
#include
#include
On 6 June 2009 at 17:03, Kynn Jones wrote:
| Consider the following simple C program:
|
| /*** hello_r.c ***/
| #include
|
| SEXP hello() {
| return mkString("Hello, world!\n");
| }
|
| int main(void) {
| SEXP x = hello();
| return x == NULL; /* i.e. 0 on success */
| }
|
| Thi
Consider the following simple C program:
/*** hello_r.c ***/
#include
SEXP hello() {
return mkString("Hello, world!\n");
}
int main(void) {
SEXP x = hello();
return x == NULL; /* i.e. 0 on success */
}
This program segfaults:
% myR/bin/R CMD LINK gcc -I./R-2.9.0/src/include -L.