Hi,

I am new in writing R extension.
I read the "Writing R Extensions", and search online but just cannot  
find the answer.

I am trying to add c-code, which depend on GSL C  library, into my R  
package.
I am using Max OS-X 10.4.3, powerpc-apple-darwin8-gcc-4.0.1

I begin wtih package.skeleton, and then add my c file into folder src
and then add  file Makevars:

PKG_LIBS=-lgsl -lgslcblas -lm

In the zzz.R file, I add the function .First.lib:

.First.lib <- function(lib, pkg) {
   library.dynam("anovaGSL", pkg, lib)
}

I think these two things are enough. then I just run R CMD check  
anovaGSL (my package name)
followed is the error message:

Error: .First.lib failed for 'anovaGSL'
Call sequence:
2: stop(gettextf(".First.lib failed for '%s'", libraryPkgName(package)),
        domain = NA)
1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose  
= FALSE)
Execution halted
See section 'Generic functions and methods' of the 'Writing R  
Extensions'
manual.
* checking replacement functions ... WARNING
Error: .First.lib failed for 'anovaGSL'
Call sequence:
2: stop(gettextf(".First.lib failed for '%s'", libraryPkgName(package)),
        domain = NA)
1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose  
= FALSE)
Execution halted
In R, the argument of a replacement function which corresponds to the  
right
hand side must be named 'value'.
* checking foreign function calls ... WARNING
Error: .First.lib failed for 'anovaGSL'
Call sequence:
2: stop(gettextf(".First.lib failed for '%s'", libraryPkgName(package)),
        domain = NA)
1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose  
= FALSE)
Execution halted
See section 'System and foreign language interfaces' of the 'Writing R
Extensions' manual.
* checking Rd files ... OK
* checking for missing documentation entries ... ERROR
Error: .First.lib failed for 'anovaGSL'


appreciate any help!!!


wei


	[[alternative HTML version deleted]]


