From murdoch at stats.uwo.ca  Wed Apr 18 05:07:12 2007
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Tue, 17 Apr 2007 23:07:12 -0400
Subject: [Rd] undefined symbol: Rf_rownamesgets
In-Reply-To: <20070418024327.GA27800@wheat.betterworld.us>
References: <20070418024327.GA27800@wheat.betterworld.us>
Message-ID: <46258B60.2080708@stats.uwo.ca>

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?

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



[Rd] undefined symbol: Rf_rownamesgets
Duncan Murdoch