[R] Call C routine problem

pingzhao pingzhao at waffle.cs.dal.ca
Thu Feb 6 04:53:03 CET 2003


When I call C function from Splus, I often meet this problem:
"Problem: Couldn't find a function definition for "Stest" "

My c function is saved as 'test.c' (the function is also named as 'test'
My splus function is saved as 'Stest', such as

Stest <-
function(d,f)
{
.C("test",
as.integer(d),
as.single(f))
}


Assume my files (test.c and Stest) have been stored in the directory ''work''
I have done the following steps in this directory:
(1) Splus CHAPTER test.c
(2) Splus make
(3) Splus
(4) d<-10
f<-rep(0,d)
result<-Stest(d,f)

then the error message is :
Problem: Couldn't find a function definition for "Stest"

What am I wrong???

Thank you for your help in advance!!!




More information about the R-help mailing list