[R] link my own C library using Rcmd SHLIB

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Sat Aug 24 08:03:53 CEST 2002


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