Skip to content
Prev 913 / 10988 Next

[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:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20100721/560264a3/attachment.htm>