我尝试在 C++(Qt 创建者)中包含 R 代码。为了熟悉包 Rcpp、RInside 和 R 源代码 R-3.0.1,我尝试运行以下示例:
#include <QCoreApplication>
#include<iostream>
#include<Rcpp.h>
#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);
}
第一个问题:
文件 string.h 来自 Rcpp 包,但它总是会产生很多(130!)错误,例如:
- '内部没有命名类型'
- 'StringProxy 没有命名类型等。
它有什么问题?
第二个问题:
在 .pro 文件中,我必须分别包含软件包的所有子文件夹,例如:
- INCLUDEPATH += "W:\hesm\Private\Private\Qt 文件\ConnectToR\Rcpp\include\Rcpp\module"
是否可以在一个引号中包含一个文件夹(包)及其所有子文件夹?
谢谢