我需要 R 头文件来编译一些东西。我通过以下方式在 ubuntu 上安装了 R:
sudo apt-get r-base-dev
R 工作正常。但我找不到 R 头文件,例如 Rmath.h。当我尝试编译时出现此错误:
gcc -g -std=c99 -I/usr/include -O3 -lRmath -lm -lpthread -o qcpg qcpg.c
In file included from qcpg.c:1:0:
qcpg.h:19:19: fatal error: Rmath.h: No such file or directory
compilation terminated.
make: *** [qcpg] Error 1
有什么想法吗?
最佳答案
你也想做
sudo apt-get install r-mathlib
其中包含文件/usr/include/Rmath.h
。
关于使用 R 头文件编译 C 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7392571/