【发布时间】:2014-02-15 07:00:17
【问题描述】:
我是使用 make 的新手,我正在尝试运行此处给出的 Qt 密度演示的 RInside 示例:http://dirk.eddelbuettel.com/blog/2011/03/25/。我已将代码保存到以下文件中:
main.cpp 生成文件 qt密度.cpp 包括/qtdensity.h
我运行的是 Ubuntu 13.10,我安装了 R、Rcpp 和 Inside。当我去终端运行时
> make -f Makefile
我得到了错误
make: *** No targets. Stop.
请告诉我如何继续。
谢谢
我看不出如何对第一个答案提出后续问题,所以我必须扩展我的问题:
我刚刚创建了文件,并且能够在 main.cpp、qtdensity.cpp、qtdensity.h 和 qtdensity.pro 上运行 qmake,但当我尝试运行 make 时,我收到以下错误:
很多与 R 相关的错误 ...
qtdensity.cpp:(.text+0x53a): undefined reference to `Rf_mkString'
qtdensity.cpp:(.text+0x54e): undefined reference to `Rf_install'
qtdensity.cpp:(.text+0x559): undefined reference to `Rf_findVarInFrame'
qtdensity.cpp:(.text+0x560): undefined reference to `R_UnboundValue'
...
qtdensity.cpp:(.text.startup+0x2a5): undefined reference to `R_NaReal'
qtdensity.cpp:(.text.startup+0x2b2): undefined reference to `R_NaN'
main.o: In function `_GLOBAL__sub_I_main':
main.cpp:(.text.startup+0x2a5): undefined reference to `R_NaReal'
main.cpp:(.text.startup+0x2b2): undefined reference to `R_NaN'
main.o: In function `main':
main.cpp:(.text.startup+0x352): undefined reference to `RInside::RInside(int, char const* const*, bool, bool, bool)'
main.cpp:(.text.startup+0x397): undefined reference to `RInside::~RInside()'
main.cpp:(.text.startup+0x3b3): undefined reference to `RInside::~RInside()'
moc_qtdensity.o: In function `_GLOBAL__sub_I__ZN9QtDensity18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv':
moc_qtdensity.cpp:(.text.startup+0x2a5): undefined reference to `R_NaReal'
moc_qtdensity.cpp:(.text.startup+0x2b2): undefined reference to `R_NaN'
collect2: error: ld returned 1 exit status
make: *** [qdensity] Error 1
【问题讨论】:
-
它没有与 R 或 RInside 链接。也许您的系统是非标准的。正如我向你展示的那样——在这里工作。