[R] main() in libR?

Ross Boylan ross at biostat.ucsf.edu
Wed Dec 15 21:05:15 CET 2004

libR seems to include a main() function.  Should it?

I'm hoping this simpler question will get more of a response than my
previous post about R a la carte :)

The evidence that libR includes main() is two-fold.  First, when I use
nm, I see the _main defined.  Second, when I run a program linked to
libR, the main R shell takes over, even though I have my own main (in
another library).

Looking at the sources, it seems the only possible contributor of
main() is src/main/Rmain.c.  I wouldn't expect this in the library,
and the documentation of the library (in "R Extensions") says you must
supply your own main.

I have tried to follow through the Makefile's, but the spot the
library is built has not jumped out at me.

I've encountered this with number of generations of R on a number of
platforms (Debian Linux and OS X).


More information about the R-help mailing list