Calling R functions from VC ++

I need to run aggregate functions from R in my C ++ code. Is there a way to call them from my C ++ code? I am using VS 2005, do I need to include any header files or link any libraries? I installed R using the standard Windows installer provided on their website.

Yours faithfully,

+5
source share
2 answers

Short:

  • As was said quite often, R does not build VS * by itself; it makes a reference to C-code rigidly, but it is also possible to C ++ - code is impossible (since the function header information is not standardized).

  • Rcpp RInside Windows,  Windows toolchain. ( RInside , .)

    Rcpp VS * (..  , R )

  • VS *,   Rserve.

    , Rcpp/RInside;   R API .

  • Rcpp . , Rcpp- pdf (   ) Rcpp-FAQ ---, .

, , . r-help.

+4

Rserve, https://rforge.net/Rserve/files/, Microsoft Visual ++. ReadMe.txt , Windows , Makefile.win. , "make -f Makefile.win", config.h ( config.h.in).

  • , Rsrv.h:


    //# "config.h"


:


rsrv.h(384): C1189: # : " . , config.h _ _ {BIG | LITTLE} _ENDIAN__ ."


  1. , . Rsvr.h :
/* Windows is little-endian is most cases, anywhere else we're stuck*/
 # error "Cannot determine endianness. Make sure config.h is included or  __{BIG|LITTLE}_ENDIAN__ is defined ."
# endif

:


/********* MODIFICATION *************/

/* # error "Cannot determine endianness. Make sure config.h is included or __{BIG|LITTLE}_ENDIAN__ is defined ." */
/************************************/
#define _BIG_ENDIAN (*(uint16_t *)?\xff? < 0x100)

  1. , Wins2 Wins2. :
/* indicate to the linker that the Ws2_32.lib file is needed */
#pragma comment(lib, "Ws2_32.lib") 

, Winsock, Ws2_32.lib.

R Microsoft Visual ++ Rserve https://www.researchgate.net/publication/305789407_Rserve_for_Windows_case_of_R_and_Microsoft_Visual_C_integration

-1

All Articles