[Rcpp-devel] cxxfunction()
param jeet
humtumiit at gmail.com
Wed Jul 21 08:34:30 CEST 2010
Hello,
I have to work with Rcpp interface. I have installed packages inline and
Rcpp.
When I use the function below, I get the error. Error is following function
statement below. How to sort out this problem?
I would appreciate your help.
fx <- cxxfunction( signature( x = "numeric" ),
+ ' NumericVector xx(x); return wrap( std::accumulate( xx.begin(), xx.end(),
0.0 ) ) ; '
+ , plugin = "Rcpp")
*ERROR(s) during compilation: source code errors or compiler configuration
errors!*
Program source:
1: // includes from the plugin
2:
3: #include <Rcpp.h>
4:
5:
6: #ifndef BEGIN_RCPP
7: #define BEGIN_RCPP
8: #endif
9:
10: #ifndef END_RCPP
11: #define END_RCPP
12: #endif
13:
14: using namespace Rcpp;
15:
16:
17: // user includes
18:
19:
20: // declaration
21: extern "C" {
22: SEXP file712b6459( SEXP x) ;
23: }
24:
25: // definition
26:
27: SEXP file712b6459( SEXP x ){
28: BEGIN_RCPP
29: NumericVector xx(x); return wrap( std::accumulate( xx.begin(), xx.end(),
0.0 ) ) ;
30: END_RCPP
31: }
32:
33:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created!
I would appreciate your help.
Regards:
Param
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20100721/daccfa2b/attachment.htm>
More information about the Rcpp-devel
mailing list