[R] problems when compiling C code

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Feb 3 00:16:26 CET 2004

On Mon, 2 Feb 2004, Stephane DRAY wrote:

> Hello,
> I would like to call C code from R. My C code is divided in two files. In 
> the file "testpermut.c", I have the following lines:
> #include "adesub.h"
> In my working folder, I have the files:
> - adesub.c which contains general functions
> - adesub.h with the header of functions contained in adesub.c
> - testpermut.c which call some functions defined in adesub.c
> When I try to  create my dll (Work on Windows XP, R-1.8.1), I obtain error 
> message:
> $ Rcmd shlib testpermut.c

You only included one of the files. You need

Rcmd SHLIB testpermut.c adesub.c

I believe.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list