This question is related to: C++ and R: Create a .so or .dll plus i have read the questions and replies of these posts:
I try to run the code provided as an example in the answer provided
#include <RInside.h>                    // for the embedded R via RInside
#include <iomanip>
int main(int argc, char *argv[]) {
  RInside R(argc, argv);              // create an embedded R instance 
  std::string txt =                   // load library, run regression, create summary
    "suppressMessages(require(stats));"     
    "swisssum <- summary(lm(Fertility ~ . , data = swiss));" 
    "print(swisssum)";             
  R.parseEvalQ(txt);                  // eval command, no return
  // evaluate R expressions, and assign directly into Rcpp types
  Rcpp::NumericMatrix     M( (SEXP) R.parseEval("swcoef <- coef(swisssum)"));                 
  Rcpp::StringVector cnames( (SEXP) R.parseEval("colnames(swcoef)"));
  Rcpp::StringVector rnames( (SEXP) R.parseEval("rownames(swcoef)")); 
  std::cout << "\n\nAnd now from C++\n\n\t\t\t";
  for (int i=0; i<cnames.size(); i++) {
    std::cout << std::setw(11) << cnames[i] << "\t";
  }
  std::cout << std::endl;
  for (int i=0; i<rnames.size(); i++) {
    std::cout << std::setw(16) << rnames[i] << "\t";
    for (int j=0; j<cnames.size(); j++) {
      std::cout << std::setw(11) << M(i,j) << "\t";
    }
    std::cout << std::endl;
  }
  std::cout << std::endl;
  exit(0);
}
The error in the CMD is the following
C:\Users\DON\Desktop>R CMD SHLIB final.cpp
g++ -m64 -I"C:/R/R-3.2.4/include" -DNDEBUG     -I"d:/RCompile/r-compiling/local/
local323/include"     -O2 -Wall  -mtune=core2 -c final.cpp -o final.o
final.cpp:1:74: fatal error: RInside.h: No such file or directory
compilation terminated.
make: *** [final.o] Error 1
Warning message:
comando ejecutado 'make -f "C:/R/R-3.2.4/etc/x64/Makeconf" -f "C:/R/R-3.2.4/shar
e/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)
' SHLIB="final.dll" WIN=64 TCLBIN=64 OBJECTS="final.o"' tiene estatus 2
Clearly it cant find the RInside.h header. I have the R installed in a folder without spaces. The PATH in global variables have: C:\R\R-3.2.4\bin; C:\Rtools\bin;C:\Rtools\gcc-4.6.3\bin
I understand that in the CMD i cant introduce comands like
$ export PKG_LIBS=‘Rscript -e "Rcpp:::LdFlags()"‘ # if Rcpp older than 0.11.0
$ export PKG_CXXFLAGS=‘Rscript -e "Rcpp:::CxxFlags()"‘
Which first defines and exports two relevant environment variables which R CMD SHLIB then relies on (as put in the FAQ file)
Any advice on this? I need to do a Makefile for each cpp file that i want to compile?