0

问候,

我正在尝试在 Eclipse 中运行 RInside 示例,但出现此错误

./rinside_sample0.o: In function `main':
D:\omnetpp-5.1\samples3\myRapp\Debug/../rinside_sample0.cpp:16: undefined reference to `RInside::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
D:\omnetpp-5.1\samples3\myRapp\Debug/../rinside_sample0.cpp:18: undefined reference to `RInside::parseEvalQ(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:46: myRapp.exe] Error 1

这是 rinside_sample0 的代码:

#include <RInside.h>                    // for the embedded R via RInside

int main(int argc, char *argv[]) {

    RInside R(argc, argv);              // create an embedded R instance

    R["txt"] = "Hello, world!\n";   // assign a char* (string) to 'txt'

    R.parseEvalQ("cat(txt)");           // eval the init string, ignoring any returns

    exit(0);
}

我在eclipse中添加了以下配置: 在此处输入图像描述 在此处输入图像描述

任何帮助弄清楚如何解决这个问题将不胜感激

4

0 回答 0