问题描述
我正在尝试使用R生成2个文件,第一个实际上生成了不错的文件,但是第二个告诉我以下内容:
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:
Rh和Rinternals.h都是从R目录复制的,它们与其余文件位于同一目录中,但我无法克服此错误,这些文件被包含这样的文件调用:
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?
推荐答案
您必须进行更改
#include <R.h>
#include <Rinternals.h>
到
#include "R.h"
#include "Rinternals.h"
如果头文件与代码文件位于同一目录中.或者,您可以在gcc命令行中添加正确的包含路径(例如 -I/usr/share/R/include
).
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
).
这篇关于尝试编译时R抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!