[Rd] undefined symbol: Rf_rownamesgets

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Apr 18 07:29:07 CEST 2007


On Tue, 17 Apr 2007, Duncan Murdoch wrote:

> On 4/17/2007 10:43 PM, Ross Boylan wrote:
>> I get the error
>>  undefined symbol: Rf_rownamesgets
>> when I try to load my package, which include C++ code that calls that
>> function.  This is particularly strange since the code also calls
>> Rf_classgets, and it loaded OK with just that.
>>
>> Can anyone tell me what's going on?
>>
>> For the record, I worked around this with the general purpose
>> attribute setting commands and R_RowNamesSymbol.  I discovered that
>> even with that I wasn't constructing a valid data.frame, and fell back
>> to returning a list of results.
>>
>> I notice Rinternals.h defines
>> LibExtern SEXP	R_RowNamesSymbol;   /* "row.names" */
>> twice in the same block of code.
>>
>> I'm using R 2.4.1 on Debian. The symbol seems to be there:
>> $ nm -D /usr/lib/R/lib/libR.so | grep classgets
>> 00032e70 T Rf_classgets
>> $ nm -D /usr/lib/R/lib/libR.so | grep namesgets
>> 00031370 T Rf_dimnamesgets
>> 00034500 T Rf_namesgets
>
> I don't see Rf_rownamesgets there, or in the R Externals manual among
> the API entry points listed.  Can't you use the documented dimnamesgets?

dimnamesgets is for arrays not data frames.  There is no 'rownamesgets' in 
the current sources, but a static row_names_gets that is called by 
setAttrib.

>
> Duncan Murdoch
>
>> The source includes
>> #define R_NO_REMAP 1
>> #include <R.h>
>> #include <Rinternals.h>
>> and later
>> #include <memory>  // I think this is why I needed R_NO_REMAP
>>
>> I realize this is not a complete example, but I'm hoping this will
>> ring a bell with someone.  I encountered this while running
>> R CMD check.  The link line generated was
>> g++ -shared  -o mspath.so AbstractTimeStepsGenerator.o Coefficients.o CompositeHistoryComputer.o CompressedTimeStepsGenerator.o Covariates.o Data.o Environment.o Evaluator.o FixedTimeStepsGenerator.o LinearProduct.o Manager.o Model.o ModelBuilder.o Path.o PathGenerator.o PrimitiveHistoryComputer.o SimpleRecorder.o Specification.o StateTimeClassifier.o SuccessorGenerator.o TimePoint.o TimeStepsGenerator.o mspath.o mspathR.o   -L/usr/lib/R/lib -lR
>>
>> Thanks.
>> Ross
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
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