我正在谈论的软件包含 5 个文件,并在以下位置编译“非常好openSUSE 11.3
” gcc-4.5.1
:
相同的软件显示以下错误Windows XP
。Mingw (gcc-4.6.3)
更新
问题被发现了。
问题出在R的功能上parseEval
。有两个类似的功能:parseEval
和parseEvalQ
。前者返回一个值,而另一个返回 void。
我parseEval
在 C++ 和 Qt 项目中使用过,它在 Linux 上运行良好,并在 Windows 上抛出上述错误。
这是可重现的示例:
演示.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";
}
对应的.pro文件:
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