[Rcpp-devel] loading failed
Fabio Tordini
tordini at di.unito.it
Tue May 5 14:30:36 CEST 2015
Hi all,
I have a C++ application I developed, with its headers (.hpp) and
related .cpp files. Within this project I use a templated header-only
library for efficient parallel computing using pthreads, as well as the
GSL library.
My intent is to use this application within a R package, and I use
RStudio under GNU Linux to create an Rcpp package.
I created a c++ function with '[[Rcpp::export]]' attribute that includes
headers of my project and wraps a sort of entry point to the
application. Something like:
#include "cppApp.hpp"
// [[Rcpp::export]]
int wrapApp(Args...) {
// set up parameters
runParallelCppApp(Params...);
return 0;
}
I carefully edited the DESCRIPTION file with lines
LinkingTo: Rcpp, RcppGSL
SystemRequirements: C++11
While the Makevars file contains:
PKG_CPPFLAGS = -DPRINTLOG -I"../inst/include" -pthread
PKG_LIBS = -lcurl -lpthread `$(R_HOME)/bin/Rscript -e \
"Rcpp:::LdFlags()"` $(R_HOME)/bin/Rscript -e "RcppGSL:::LdFlags()"`
CXX_STD = CXX11
Everything compiles fine, but then it fails when loading the package:
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object
'/home/fabio/R/x86_64-pc-linux-gnu-library/3.0/NgrapH/libs/NgrapH.so':
/home/fabio/R/x86_64-pc-linux-gnu-library/3.0/NgrapH/libs/NgrapH.so:
undefined symbol: _ZN6Finder10parseFilesESsSsSs
Error: loading failed
What could possibly be the problem?
Thanks in advance,
Fabio
More information about the Rcpp-devel
mailing list