[R] .C() and C++ name mangling

Douglas Bates bates at stat.wisc.edu
Wed Oct 2 23:41:52 CEST 2002


Andy Jacobson <andyj at splash.princeton.edu> writes:

> Howdy,
> 
>         I'm working with some external code written in C++, which I
>         would like to call via dyn.load() and .C() from R.  The
>         function prototype looks like:
> 
>         gaRemin(int *, float *, float *, int *, float *, float *, 
>                 float *, float *, float *)
> 
>         but to call this function from R using .C() I have had to use
>         the mangled version of this function name,
> 
>         gaRemin__FPiPfT1T0T1N41
> 
>         Is using the mangled name my best option, or is there some way
>         that R knows to interpret unmangled function names from C++
>         shared library objects?
> 
>         I'm concerned about portability of the resultant code in the
>         case that name-mangling is handled differently from platform
>         to platform.
> 
>         This is Linux, Redhat 7.2 with g++-2.96.
> 
>         Thanks for any help you can offer,
> 
>                 Andy
> 
> -- 
> Andy Jacobson
> 
> arj at gfdl.gov
> 
> Program in Atmospheric and Oceanic Sciences
> Sayre Hall, Forrestal Campus
> Princeton University
> PO Box CN710 Princeton, NJ 08544-0710 USA
> 
> Tel: 609/258-5260  Fax: 609/258-2850
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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 at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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 at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list