0

I 'm new in QT. I meet a problem in using RInside, hope to get some help.

int main(int argc, char *argv[]) {
    RInside R(argc, argv);
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
}

when compling this,error happened.

enter image description here

the compiler is "Desktop Qt MinGW 32bit",the qmake configure is like this, I also try add RInside lib like "

QMAKE_LIBDIR += $$quote(C:/Program Files/R/R-3.5.1/library/RInside/libs/x64)
QMAKE_LIBDIR += $$quote(C:/Program Files/R/R-3.5.1/library/RInside/lib/i386)
QMAKE_LIBDIR += $$quote(C:/Program Files/R/R-3.5.1/library/RInside/lib/x64)

all of there don't work.

enter image description here

thanks for your help!

r2evans
  • 141,215
  • 6
  • 77
  • 149
  • I suspect this is more about RInside. In the past, Dirk (RInside developer/maintainer) has suggested questions like this should go directly to the mailing list instead of SO, so I suggest this will get better support there: [rcpp-devel](http://lists.r-forge.r-project.org/mailman/listinfo/rcpp-devel). – r2evans Sep 05 '18 at 02:58
  • thank you for your help, you mean my problem may be caused by Rcpp, not by RIside? – 扑克侠 Sep 05 '18 at 03:18
  • Not necessarily Rcpp, but I'm assuming the "base package" refers to R's `base` package, so that suggests that there is some Rcpp/R connectivity that is not working correctly. So not Rcpp, more likely RInside. (If you go to [RInside](http://dirk.eddelbuettel.com/code/rinside.html)'s web page, under "Support" it mentions the rcpp-devel mailing list, ergo my suggestion.) – r2evans Sep 05 '18 at 03:21
  • OK,thank you very much for your help! – 扑克侠 Sep 05 '18 at 06:22
  • Have you looked at the QT example available in the examples folder or at https://github.com/eddelbuettel/rinside/tree/master/inst/examples/qt? – Ralf Stubner Sep 05 '18 at 07:34
  • I also try to run this example, but errors happen when compiling. "C:/R/R-3.5.1/library/Rcpp/include/Rcpp/r/headers.h:52:15: fatal error: R.h: No such file or directory compilation terminated." It seems that the environment variable of R has no problem, "Project MESSAGE: R_HOME is C:\R\R-3.5.1". – 扑克侠 Sep 05 '18 at 09:07
  • this is the configure of qmake R_HOME = $$system(R RHOME) RCPPFLAGS = $$system($$R_HOME/bin/x64/R CMD config --cppflags) RLDFLAGS = $$system($$R_HOME/bin/R CMD config --ldflags) RBLAS = $$system($$R_HOME/bin/R CMD config BLAS_LIBS) RLAPACK = $$system($$R_HOME/bin/R CMD config LAPACK_LIBS) RCPPINCL = $$system($$R_HOME/bin/Rscript -e \"Rcpp:::CxxFlags\(\)\") RCPPLIBS = $$system($$R_HOME/bin/Rscript -e \"Rcpp:::LdFlags\(\)\") RINSIDEINCL = $$system($$R_HOME/bin/Rscript -e \"RInside:::CxxFlags\(\)\") RINSIDELIBS = $$system($$R_HOME/bin/Rscript -e \"RInside:::LdFlags\(\)\") – 扑克侠 Sep 05 '18 at 09:11
  • I think I had that happen to me too when I used this on Windows (a long time ago), and it may be a `$PATH` thing. A brutal and ugly test may be to copy the required DLLs for R into directory where your app resides. If that runs, then the code per se is find, it is "just" that it lacks Windows resources. – Dirk Eddelbuettel Sep 05 '18 at 14:24
  • thank for your help, dear Dirk! But it is a pity that this does not work. My OS is win7, do Rcpp and RInside support it? This is the structure of Rcpp pakage, no "lib" directory, and no .a files in libs. I wonder whether the release of Rcpp has some problems. – 扑克侠 Sep 10 '18 at 01:04

0 Answers0