I am trying to use R to generate 2 files the first one actually generates pretty good but the 2nd one tells me the following:
conteo_correlaciones.c:3:15: error: R.h: No such file or directory
conteo_correlaciones.c:4:24: error: Rinternals.h: No such file or
directory conteo_correlaciones.c:31: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘attribute’ before ‘countcorrelations’
both R.h and Rinternals.h were copied from the R directory and they’re in the same directory that the rest of the files but I can’t get past this error, these files are being called by an include like this:
#include <R.h>
#include <Rinternals.h>
and what I’m doing in the terminal is:
R CMD SHLIB conteo_correlaciones.c
Which works great and generates me the correct file and:
gcc -dynamiclib conteo_correlaciones.c -o conteo_correlaciones.so
Which throws me the aforementioned error. Any idea what could be?
You have to change
to
if the header files are in the same directory like your code files.
Or you could add the correct include-path to gcc commandline (e.g.
-I/usr/share/R/include).