[R] How to resolve include Rcpp.h problems?

Amine Jallouli jallouli.med.amine at gmail.com
Sun Dec 13 09:56:48 CET 2009


Hi,
I am Linux Ubuntu 9.04 user. I'm using R-2.6.

Actually, I am developing R package for reading/writing 3D images. I needed
to use  the R package Rcpp in order to make profit of available C/C++ codes.
My problem is that my C code is not able to include the Rcpp.h

In fact, when I run this command R CMD build rply, I got the following error
message in the file /home/amine/R/r-eclipse/rply.Rcheck/00install.out:
* Installing *source* package 'rply' ...
** libs
gcc -std=gnu99 -I/usr/share/R/include      -fpic  -g -O2 -c Call_interface.c
-o Call_interface.o
gcc -std=gnu99 -I/usr/share/R/include      -fpic  -g -O2 -c C_interface.c -o
C_interface.o
gcc -std=gnu99 -I/usr/share/R/include      -fpic  -g -O2 -c fifrt.c -o
fifrt.o
g++ -I/usr/share/R/include      -fpic  -g -O2 -c RCPP_test.cpp -o
RCPP_test.o
RCPP_test.cpp:1:18: erreur: Rcpp.h : No such file or directory
RCPP_test.cpp: In function ‘SEXPREC* readRIntVec(SEXPREC*)’:
RCPP_test.cpp:14: erreur: ‘RcppVector’ was not declared in this scope
RCPP_test.cpp:14: erreur: expected primary-expression before ‘int’
RCPP_test.cpp:14: erreur: expected `;' before ‘int’
make: *** [RCPP_test.o] Erreur 1
ERROR: compilation failed for package 'rply'
** Removing '/home/amine/R/r-eclipse/rply.Rcheck/rply'

It is evident that I will this error since the file Rcpp.h is not in this
directory /usr/share/R/include .

I tried to solve this include problem by copying the Rcpp.h to
/usr/share/R/include. But, it was not successful and I the following error
message.

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  Unable to load shared library
'/home/amine/R/r-eclipse/rply.Rcheck/rply/libs/rply.so':
  /home/amine/R/r-eclipse/rply.Rcheck/rply/libs/rply.so: undefined symbol:
_ZN10RcppVectorIiEC1EP7SEXPREC
Error in library(rply) : .First.lib has failed for 'rply'
Execution stopped

It looks like this package has a loading problem: see the messages for
details.


Resulting this last error seems to be also logical. In fact, I think the
file libRcpp.so is need for the compilation of my code.

Please notice that the package Rcpp is installed in the following directory:
/usr/lib/R/site-library/Rcpp

Thank you for giving an idea for solving this problem.
-- 
View this message in context: http://n4.nabble.com/How-to-resolve-include-Rcpp-h-problems-tp962875p962875.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list