Re: [R] R CMD SHLIB: file not recognized: File format not recognized

2008-10-19 Thread Andreas Wittmann
Hello Dirk, thank you for your chick answer. I tried another file and there it works. so i removed all files which were created during of the compilation of add.c in windows and so i could compile it under ubuntu too. During the windows compilation there is some *.o file which is created during

Re: [R] R CMD SHLIB: file not recognized: File format not recognized

2008-10-19 Thread Prof Brian Ripley
From the help page: 'R CMD SHLIB' is the mechanism used by 'INSTALL' to compile source code in packages. Please consult section 'Creating shared objects' in the manual 'Writing R Extensions' for how to customize it (for example to add 'cpp' flags and to add libraries to the link

Re: [R] R CMD SHLIB: file not recognized: File format not recognized

2008-10-19 Thread Duncan Murdoch
Andreas Wittmann wrote: Hello Dirk, thank you for your chick answer. I tried another file and there it works. so i removed all files which were created during of the compilation of add.c in windows and so i could compile it under ubuntu too. During the windows compilation there is some *.o file

[R] R CMD SHLIB: file not recognized: File format not recognized

2008-10-18 Thread Andreas Wittmann
Dear R useRs, on ubuntu 8.04 i try to create a shared object out of a c-file this is // add.c #include Rinternals.h SEXP addiere(SEXP a, SEXP b) { int i, n; n = length(a); for (i = 0; i n; i++) REAL(a)[i] += REAL(b)[i]; return(a); } in terminal i type R CMD SHLIB add.c and get gcc

Re: [R] R CMD SHLIB: file not recognized: File format not recognized

2008-10-18 Thread Dirk Eddelbuettel
On Sun, Oct 19, 2008 at 01:27:06AM +0200, Andreas Wittmann wrote: Dear R useRs, on ubuntu 8.04 i try to create a shared object out of a c-file this is // add.c #include Rinternals.h SEXP addiere(SEXP a, SEXP b) { int i, n; n = length(a); for (i = 0; i n; i++) REAL(a)[i] +=