开发者

R/C++ Interface

How to use RCPP_MODULE(yada) in C++. My C++ program gives error if I use

const char* hello( std::string who ){
std::string result( "hello " ) ;
result += who ;
return result.c_str() ;
}

RCPP_MODULE(yada)
{
using namespace std;
function( "hello", &hello ) ;
};

Error are:

1. Error 1 error C2065: 'yada' : undeclared ide开发者_如何学运维ntifier

2. Error 2 error C2448: 'RCPP_MODULE' : function-style initializer appears to be a function definition

Can anyone help me in fixing these error?


Rcpp does not work with Visual Studio, see Question 2.7 in Rcpp FAQ.


The point of RCPP_MODULE is to expose C++ to R.

You need to include R.h and Rdefines.h and state using namespace Rcpp;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜