- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我是 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
最佳答案
Qt 示例不同,因为它使用了 Qt。您总是需要从 .pro 文件创建 Makefile 本身开始。证人:
edd@max:~/git/rinside/inst/examples/qt$ ls -l ## no Makefile
total 28
drwxrwxr-x 2 edd edd 4096 Dec 27 18:38 cmake
-rw-rw-r-- 1 edd edd 518 Dec 27 18:38 main.cpp
-rw-rw-r-- 1 edd edd 5953 Dec 27 18:38 qtdensity.cpp
-rw-rw-r-- 1 edd edd 1532 Dec 27 18:38 qtdensity.h
-rw-rw-r-- 1 edd edd 2378 Feb 11 20:14 qtdensity.pro
-rw-rw-r-- 1 edd edd 887 Dec 27 18:38 README
edd@max:~/git/rinside/inst/examples/qt$ qmake ## creates Makefile
edd@max:~/git/rinside/inst/examples/qt$ make
g++ -c -m64 -pipe -I/usr/share/R/include [... lots and lots omitted ...]
g++ -m64 -Wl,-O1 -o qtdensity qtdensity.o main.o moc_qtdensity.o [....]
edd@max:~/git/rinside/inst/examples/qt$ ls -l qtdensity
-rwxrwxr-x 1 edd edd 76666 Feb 14 15:02 qtdensity
edd@max:~/git/rinside/inst/examples/qt$
这个是当然也在这个目录的README中描述了...
关于c++ - RInside 编译 : Make Targets,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21789318/
我正在尝试通过 RInside 在 linux 上从 c++ 调用 R,我使用 gcc 版本 4.5.3 (Debian 4.5.3-1) 从源代码编译 R-2.15.1,我没有使用 sudo 的权限
一个简单的实验表明,每个线程一次只允许一个 RInside 实例。 #include int main() { RInside R1; R1.parseEval("cat('Hello, R
所以,我一直在尝试将 RInside 用于应用程序,但我无法弄清楚这个问题。我读过这个问题,我想我在做同样的事情:Passing RInside's 'R' instance as a paramet
我在编译使用 QtCreator 编写的项目时遇到问题。第一件事是该项目在 OS X 下运行良好(如果它是第一个开发的),并且不能在 Linux (Mint) 下编译。由于 Linux 区分大小写而
我想使用 RInside 编译 R 代码。但是我在使用函数 read.csv 时遇到错误。代码片段如下: include "RInside.h" include include include
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
我在 RCpp 邮件列表中找不到关于 RInside 的几个问题。你能在 C++ main() 方法之外定义 RInside() 吗?有这方面的例子吗?或者我可以在每个 C++ 应用程序中只有一个 R
我让 RInside 示例运行并工作,但我必须手动添加链接器选项:g++ 末尾的“-F/Library/Frameworks/R.framework/.. -framework R”(在带有 Xcod
我理解 RInside 允许 C++ 程序嵌入 R 代码,而 Rcpp 允许 R 代码调用 C++ 函数或库。 RInside 和 Rcpp 之间还有其他区别和共同点吗?为什么 RInside 有一个
我是 make 的新手,我正在尝试运行此处给出的 Qt 密度演示的 RInside 示例:http://dirk.eddelbuettel.com/blog/2011/03/25/ .我已将代码保存到
我在 Ubuntu 上处理 RInside。我已经安装了 R、Rcpp 和 RInside。我成功地构建了我的 C++ 代码,但是当我运行我的程序时,我收到下一个错误:第一行 RInside R(ar
我理解 RInside 允许 C++ 程序嵌入 R 代码,而 Rcpp 允许 R 代码调用 C++ 函数或库。 RInside 和 Rcpp 之间还有其他区别和共同点吗?为什么 RInside 有一个
我正在尝试使用 Rinside 编译 Rarmadillo 示例,但我不断得到: In file included from rinside_arma0.cpp:8:0: /usr/local64/o
我想在 c++x11 代码中使用 RInside 来调用 R 例程。默认情况下,R 似乎安装了库的 c++98 版本,因此链接不成功。我想知道我应该继续安装 c++x11 版本的 RInside 的不
我的 RInside 程序 test_rinside 在从 ubuntu 14.04 源安装 R 的服务器上运行良好。切换到手动编译R的服务器后,RInside程序报 fatal error : ca
我目前正在尝试使用 RInside 在回测中做一些绘图,灵感来自 Saving Lattice Plots with RInside and Rcpp .我在编译 RInside 时遇到了问题。在深入
我在使用 RInside 与控制台时遇到了问题。这一切都在 ubuntu 14.04 上运行,使用通过 apt-get 从 CRAN 安装的 R 3.2.4。这是 C++ 和 R 代码: #inclu
是否有人对可以开箱即用的 RInside 的某些 R 包有深入的了解?我正在寻找 R 包的有希望的支持:量化分析,量化模型,性能分析,和TTR换句话说,如果我使用 RInside,我可以直接在我的 C
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
我正在通过终端运行这个例子。但是得到了fatal error: RInside.h: No such file or directory该行错误,#include .它是从 C++ 到 R 的接口(i
我是一名优秀的程序员,十分优秀!