[Rd] read.table() code fails outside of the utils package

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Apr 21 19:44:05 CEST 2014

On 21/04/2014 18:08, Andrew Piskorski wrote:
> On Mon, Apr 21, 2014 at 12:43:55PM -0400, Simon Urbanek wrote:
>> And that's how it should be - there is not reason why any other code should link to it. Why don't you just use
>> .External(utils:::C_readtablehead, ...)
> Ah, that works fine, and is nice and simple.  So problem solved, thank
> you!
> I do still wonder though, with the C symbol made visible in utils.so,

That isn't true on platforms which support hiding entry points.  Try

% nm -g library/utils/libs/utils.so | grep readtablehead

on Linux.

> how come this still failed?:
>     .External("readtablehead", ..., PACKAGE="utils")
>     Error: "readtablehead" not available for .External() for package "utils"

Rather, you need to tell us why that should have worked ....  Maybe you 
failed to read in the code

R_init_utils(DllInfo *dll)
     R_registerRoutines(dll, NULL, CallEntries, NULL, ExtEntries);
     R_useDynamicSymbols(dll, FALSE);
     R_forceSymbols(dll, TRUE);

See 'Writing R Extensions'.

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-devel mailing list