【问题标题】:Rcpp & RInside link errorRcpp & RInside 链接错误
【发布时间】:2015-08-28 04:12:39
【问题描述】:

我在 Kubuntu 14.04 上运行 R3.1,并使用 Codeblocks 作为 IDE 来尝试 Dirk Eddelbuettels 的 RInside 程序,例如:

http://dirk.eddelbuettel.com/blog/2011/03/25/#rinside_and_qt `

// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
//
// GPL'ed
#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);
}

`

我收到以下错误:

/usr/bin/ld: obj/Debug/main.o||对符号'REprintf'的未定义引用|

而且我不知道缺少什么库。有人知道吗?

谢谢

【问题讨论】:

  • 这个错误意味着你没有链接到libR

标签: rcpp rinside


【解决方案1】:

这是我开发的环境(除了我现在在 15.05 上的差异),几乎可以肯定它可以工作 - 但你收到一个错误,表明你没有链接到 libR

几乎可以肯定因为您没有按照自述文件的建议进行操作,即目录examples/standard/ do 中的十几个示例

make                 # compile and link all 
./rinside_sample0    # run the first 

如果您坚持使用 IDE,您可以使用贡献的 cmake/ 目录。但是代码经过测试和发布,可与 (GNU)makefile 一起使用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多