Compiling C code with R header files
I need R header files to compile something. I installed R on ubuntu via:
sudo apt-get r-base-dev
R works fine. But I can't find the R headers such as Rmath.h. I get this error when I try to compile:
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
Any ideas??
You also want to do
sudo apt-get install r-mathlib
which contains, among other things, the file /usr/include/Rmath.h
.
精彩评论