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 -std=gnu99 -shared  -o add.so add.o   -L/usr/lib/R/lib -lR
add.o: file not recognized: File format not recognized

my gcc version is 4.2.3 and my R version is 2.7.2.

Searching R-help, Writing R Extensions and R Installation and Administration guide
i don't get any idea whats wrong here?

Creating a dll-file on windows xp with the same c-file works fine.

best regards

Andreas

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to