[R] link my own C library using Rcmd SHLIB

Xiaoping Jin xiaopinj at biostat.umn.edu
Sat Aug 24 08:32:02 CEST 2002

Hi Dr Ripley,

Thank you for your email!
Since I am a beginner on R, Could you tell me a little more, if you have
First, where I can find makevar.win? I only saw "makefile" in my PC.
Second, how to set PKG_LIBS in that file?
I have read manaul agian, if I did something in this file, I can use -l or
-L flags to pass linker, am I right?

By the way, I have read your splus book, there you mentioned gnu complier.
I can use gcc, dllwrap tool. Can I do this way?

Now I am trying to firgure those out. I have some own package ( .a file),
and I want to use them when I use .C function.



On Sat, 24 Aug 2002 ripley at stats.ox.ac.uk wrote:

> On Fri, 23 Aug 2002, Xiaoping Jin wrote:
> > Hi All,
> >
> > I have already used gcc to creat a library, for example, it is called
> > "test.a", which includes many
> > c objects.
> >
> > How to link my main "a.c" function to this library when I used Rcmd SHLIB
> > to complier my main c program?
> >
> > I tried "Rcmd SHLIB a.c test.a". It does not work this way. Does anyone
> > have idea about this?
> Set PKG_LIBS in a file Makevars.win just as you would do when setting up
> the sources for an R package (which I think would be the preferred way to
> do this).
> --
> 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 272860 (secr)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list