p.jeet 0 Newbie Poster

Hello all,
I am using R for my analysis and require C++ code to access in R. I used Rcpp package in R to accesss C++ code. But when I use the function given as an example:

const char* hello( std::string who ){
std::string result( "hello " ) ;
result += who ;
return result.c_str() ;
}
RCPP_MODULE(yada){
using namespace Rcpp ;
function( "hello", &hello ) ;
}

in C++ I get 2 errors:
1. Error 1 error C2065: 'yada' : undeclared identifier
2. Error 2 error C2448: 'RCPP_MODULE' : function-style initializer appears to be a function definition.


Can anyone help me in fixing these error or acessing C++ code in R?