Re: R-beta: linking c++ functions

Kung-Sik Chan (kchan@stat.uiowa.edu)
Sun, 14 Sep 1997 18:14:00 -0700


Date: Sun, 14 Sep 1997 18:14:00 -0700
From: Kung-Sik Chan <kchan@stat.uiowa.edu>
To: Ross Ihaka <ihaka@stat.auckland.ac.nz>
Subject: Re: R-beta: linking c++ functions

Ross,

Many thanks for your suggestions. I have tried the trick, but got another
error message:

>  dyn.load('/usr/lib/libg++.so')
> library(chaos)
/usr/local/lib/R/bin/R.binary: '/usr/local/lib/R/bin/' is not an ELF file
Error in dyn.load(system.file("lib", name)) : unable to load shared library "/us
r/local/lib/R/bin/"
> traceback()
[1] "library.dynam(\"chaos.so\")"   "eval(i, env)"
[3] "lib.source(file, env)"         ".library(name, lib = lib.loc)"
[5] "library(chaos)"  

I run R in the directory /usr/local/lib/R/bin, but the same error
message pops up if I run R in directory x, with the "/usr/local/lib/R/bin"
replaced by "x".

I have no idea how to deal with this error. Any suggestions? 


Kung-Sik

> You are pretty much on your own when it comes to C++, I don't have any
> idea if what you want to do will work.  BUT, it looks like you are
> missing routines to handle streams.  You could try using "dyn.load" to
> load these missing routines from a system library before using
> 	
> 	library(chaos)
> 
> Something like
> 
> 	dyn.load("/usr/local/lib/libg++.so")
> 
> may do the trick, but I really have no idea.
> 
> I think that Doug Bates has some experience with using C++ with R ...
> 
> 	Ross
> 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=