[Rprotobuf-yada] linking against R shared library

Romain Francois romain.francois at dbmail.com
Sat Nov 7 10:51:20 CET 2009


I'm trying to use the limited connection api using R_outpstream_st that 
is defined in Rinternals.h

I have code that looks like this (trimmed of do_serializeToConn) :

     Rconnection con   ;
     struct R_outpstream_st out;
     R_pstream_format_t type = R_pstream_binary_format ;
     SEXP (*hook)(SEXP, SEXP) = NULL ;
     con = getConnection(Rf_asInteger(connection));
     R_InitConnOutPStream(&out, con, type, 0, hook, R_NilValue );

The issue I have at the moment is with the call to "getConnection", so I 
was trying to do things like this :

#ifndef LibExtern
#define LibExtern extern
LibExtern Rconnection getConnection(int);

but for this I think we need to link against the R shared lib ? Do you 
know how to do this.


Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
|- http://tr.im/BcPw : celebrating R commit #50000
|- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc
`- http://tr.im/yw8E : New R package : sos

More information about the Rprotobuf-yada mailing list