Hi

I've written the following program:

#include <R.h>
#include <Rdefines.h>
#include "Projector.h"

SEXP Projector2(SEXP L, SEXP G, SEXP W, SEXP xymod, SEXP modif){
 int nprot=0;
 PROTECT(L=AS_NUMERIC(L));nprot++;
 PROTECT(G=AS_NUMERIC(G));nprot++;
 PROTECT(W=AS_NUMERIC(W));nprot++;
 PROTECT(xymod=AS_INTEGER(xymod));nprot++;
 PROTECT(modif=AS_NUMERIC(modif));nprot++;
 double *lptr; lptr=REAL(L);
 double *gptr; gptr=REAL(G);
 double *wptr; wptr=REAL(W);
 int *xyptr; xyptr=INTEGER(xymod);
 double *ifptr; ifptr=REAL(modif);
 int *dimL; dimL=INTEGER(GET_DIM(L));
 int *dimG; dimG=INTEGER(GET_DIM(G));
 int *dimW; dimW=INTEGER(GET_DIM(W));
 int *dimxy; dimxy=INTEGER(GET_DIM(xymod));
 int *dimif; dimif=INTEGER(GET_DIM(modif));
 SEXP ans;
 PROTECT(ans=allocMatrix(REALSXP, dimG[0], dimL[1])); nprot++;
 double *ansptr; ansptr=REAL(ans);
 Projector(lptr, dimL, gptr, dimG, wptr, dimW, xyptr, dimxy, ifptr, dimif,
ansptr);
 UNPROTECT(nprot);
 return ans;
}

The question is that the function "Projector" runs well, but when I try:

R CMD SHLIB Projector2.c Projector.c

It shows:
Projector2.c: In function 'Projector':
Projector2.c:5:64: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '{' token
Projector2.c:28:1: error: expected '{' at end of input
make: *** [Projector2.o] Error 1
Warning message:
running command 'R CMD SHLIB Projector2.c Projector.c' had status 1


What's the problem? Thanks all!

Regards

Li Shangru

-- 
Department of Mathematics,
National University of Singapore,
Blk S17, 10 Lower Kent Ridge Road,
119076

	[[alternative HTML version deleted]]

