[R] dyn.load() error: bad external relocation length

From: Walton A. Green <walton.green_at_yale.edu>
Date: Sat 29 Oct 2005 - 21:34:32 EST


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:


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


platform powerpc-apple-darwin7.9.0

arch     powerpc                  
os       darwin7.9.0              
system   powerpc, darwin7.9.0     
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 Received on Sat Oct 29 21:46:41 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:53 EST