[Rcpp-devel] cxxfunction()
Hello Mr. Romain,
Thanks for replying. Yes it is window. How to check R is correctly
installed?
Even with verbose it does not work. It give the same error. I am printing
sessionInfo() result and cxxfunction with verbose below.
*> sessionInfo()
*R version 2.11.1 (2010-05-31)
i386-pc-mingw32
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
States.1252 LC_MONETARY=English_United States.1252
LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] inline_0.3.5
loaded via a namespace (and not attached):
[1] tools_2.11.1
fx <- cxxfunction( signature(x = "integer", y = "numeric" ) , '
+ return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
+ ' ,verbose = FALSE)
ERROR(s) during compilation: source code errors or compiler configuration
errors!
Program source:
1: // includes from the plugin
2: #include <R.h>
3: #include <Rdefines.h>
4: #include <R_ext/Error.h>
5:
6:
7: // user includes
8:
9:
10: // declaration
11: extern "C" {
12: SEXP file4a313dd0( SEXP x, SEXP y) ;
13: }
14:
15: // definition
16:
17: SEXP file4a313dd0( SEXP x, SEXP y ){
18:
19: return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
20:
21: Rf_warning("your C++ program does not return anything");
22: return R_NilValue ;
23: }
24:
25:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created!
Thanks
Param
On Wed, Jul 21, 2010 at 6:56 PM, <romain at r-enthusiasts.com> wrote:
Hello,
Thanks for reposting here. Which operating system is this ? If windows, do
you have Rtools properly installed ?
Can you try to use the "verbose" argument of cxxfunction
Romain
Le 21 juil. 2010 ? 02:34, param jeet <humtumiit at gmail.com> a ?crit :
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
_______________________________________________ Rcpp-devel mailing list Rcpp-devel at lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20100721/560264a3/attachment.htm>