R-helpers,

Is there an easy way to call an external (C) program using .C or .Call 
without including the code in a package. I know how to do it using 
system(), but that doesn't seem to be a permanent or portable solution. 
Initially I tried:

.Call('filepath.to.c.function', arg1)

and got this error:

Error in .Call("filepath.to.c.function", "arg1",  : 
        "C" function name not in load table

So read the section on foreign language interfaces in the Writing R 
Extensions manual but when I tried:

dyn.load('filepath.to.c.function')

I got:

Error in dyn.load(x, as.logical(local), as.logical(now)) : 
        unable to load shared library 'filepath.to.c.function':
  dlopen(filepath.to.c.function, 6): bad external relocation length

Do you need to run R_registerRoutines before dyn.load()? I couldn't find 
any mention of this error on the web....

Walton

platform powerpc-apple-darwin7.9.0
arch     powerpc                  
os       darwin7.9.0              
system   powerpc, darwin7.9.0     
status                            
major    2                        
minor    1.1                      
year     2005                     
month    06                       
day      20                       
language R

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to