The software I am talking of contains 5 files and compiles "perfectly fine" on openSUSE 11.3
with gcc-4.5.1
:
The same software shows the following error on Windows XP
with Mingw (gcc-4.6.3)
.
UPDATE
The problem is discovered.
The problem is w.r.t the R's function parseEval
.
There are two similar functions: parseEval
and parseEvalQ
.
The former returns a value, and the other returns void.
I have used parseEval
in a C++ plus Qt project, and it works very fine on Linux, and throws the above shown error on Windows.
Here is the reproducible example:
demo.cpp
#include <iostream>
#include <RInside.h>
#include <Rcpp.h>
RInside R (0, NULL);
RInside & qtToR (R);
int main ()
{
int numberOne = 1;
int numberTwo = 2;
qtToR ["numberOne"] = numberOne;
qtToR ["numberTwo"] = numberTwo;
R.parseEvalQ ("sum = numberOne + numberTwo;");
int returnValue = R.parseEval ("sum");
std :: cout << "\n" << returnValue << "\n";
}
Corresponding .pro file:
TEMPLATE = app
TARGET =
DEPENDPATH += .
SOURCES += demo.cpp
INCLUDEPATH += .
INCLUDEPATH += c:/R-2.15.1/include
INCLUDEPATH += c:/R-2.15.1/library/Rcpp/include
INCLUDEPATH += c:/R-2.15.1/library/RInside/include
LIBS += -Lc:/R-2.15.1/bin/i386 -lR
LIBS += -Lc:/R-2.15.1/library/Rcpp/libs/i386 -lRcpp
LIBS += -Lc:/R-2.15.1/library/RInside/libs/i386 -lRInside
# You'll keep pulling your hair if you miss this statement when you are on windows.
CONFIG += console