Hi Ben,
I call the following function:
> fx <- inline::cxxfunction( signature(x = "integer", y = "numeric"),'return ScalarReal( INTEGER(x)[0] * REAL(y)[0] )',verbose=TRUE)
And the whole error is:
>> Program source :
1 :
2 : // includes from the plugin
3 : #include <R.h>
4 : #include <Rdefines.h>
5 : #include <R_ext/Error.h>
6 :
7 :
8 : // user includes
9 :
10 :
11 : // declarations
12 : extern "C" {
13 : SEXP fileabc6684483e( SEXP x, SEXP y) ;
14 : }
15 :
16 : // definition
17 :
18 : SEXP fileabc6684483e( SEXP x, SEXP y ){
19 : return ScalarReal( INTEGER(x)[0] * REAL(y)[0] )
20 : Rf_warning("your C++ program does not return anything");
21 : return R_NilValue ;
22 : }
23 :
24 :
Compilation argument:
C:/R/R-3.3.1/bin/x64/R CMD SHLIB fileabc6684483e.cpp 2> fileabc6684483e.cpp.err.txt
C:/Rtools/mingw_64/bin/g++ -I"C:/R/R-33~1.1/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -c fileabc6684483e.cpp -o fileabc6684483e.o
fileabc6684483e.cpp: In function 'SEXPREC* fileabc6684483e(SEXP, SEXP)':
fileabc6684483e.cpp:20:1: error: expected ';' before 'Rf_warning'
Rf_warning("your C++ program does not return anything");
^
make: *** [fileabc6684483e.o] Error 1
Warning message:
Run 'make -f "C:/R/R-33~1.1/etc/x64/Makeconf" -f "C:/R/R-33~1.1/share/make/
winshlib.mk" -f "C:\Users\DELL\Documents/.R/Makevars" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="fileabc6684483e.dll" WIN=64 TCLBIN=64 OBJECTS="fileabc6684483e.o"' condition is 2.
ERROR(s) during compilation: source code errors or compiler configuration errors!
Program source:
1:
2: // includes from the plugin
3: #include <R.h>
4: #include <Rdefines.h>
5: #include <R_ext/Error.h>
6:
7:
8: // user includes
9:
10:
11: // declarations
12: extern "C" {
13: SEXP fileabc6684483e( SEXP x, SEXP y) ;
14: }
15:
16: // definition
17:
18: SEXP fileabc6684483e( SEXP x, SEXP y ){
19: return ScalarReal( INTEGER(x)[0] * REAL(y)[0] )
20: Rf_warning("your C++ program does not return anything");
21: return R_NilValue ;
22: }
23:
24:
Compilation ERROR, function(s)/method(s) not created! fileabc6684483e.cpp: In function 'SEXPREC* fileabc6684483e(SEXP, SEXP)':
fileabc6684483e.cpp:20:1: error: expected ';' before 'Rf_warning'
Rf_warning("your C++ program does not return anything");
^
make: *** [fileabc6684483e.o] Error 1
Warning message:
Run 'make -f "C:/R/R-33~1.1/etc/x64/Makeconf" -f "C:/R/R-33~1.1/share/make/
winshlib.mk" -f "C:\Users\DELL\Documents/.R/Makevars" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="fileabc6684483e.dll" WIN=64 TCLBIN=64 OBJECTS="fileabc6684483e.o"' condition is 2
Warning message:
Run 'C:/R/R-3.3.1/bin/x64/R CMD SHLIB fileabc6684483e.cpp 2> fileabc6684483e.cpp.err.txt' condition is 1.
Thanks for your help!
Best Regards,
Ding