Click here to Skip to main content
15,908,906 members

Comments by AshwiniKJ (Top 2 by date)

AshwiniKJ 19-Jun-17 7:48am View    
Hi Richard,

I guess the R library does not get built while installing R in windows. Can you please guide me on how to build this library. I saw R.dll in C:\Program Files\R\R-3.3.2\bin\i386 folder. But could not find the corresponding library. I am using R on windows 2008 OS and Visual Studio for C++ compilaton.
AshwiniKJ 19-Jun-17 7:39am View    
I have a separate R script that is reading CSV and performing the task. Now I need to call that script/method from that script directly from my C++ code.

This is how I tried,

#include "stdafx.h"
#include <stdio.h>
#include <string.h>
#include "Rinternals.h"
#include "Rembedded.h"

SEXP hello() {
return mkString("Hello, world!\n");
}

int main(int argc, char **argv) {
SEXP x;
Rf_initEmbeddedR(argc, argv);
x = hello();
return 0; //x == NULL; /* i.e. 0 on success */
}


Geting following linker error:

error LNK2019: unresolved external symbol _Rf_initEmbeddedR referenced in function _main