简体   繁体   中英

Package compilation dynamic library loading error

I am wrapping a small c++ program in R by using Rcpp, and I checked beforehand that the c++ code is compiling directly with g++ 4.8.4 without warnings or errors. There are no external librairies, only STL is used.

When I compile my package in RStudio with devtools, I obtain the following error:


Updating PerseusR documentation
Loading PerseusR
Error in dyn.load(dllfile) : 
  unable to load shared object '/home/leonid/Documents/Programmation/PerseusR project/PerseusR/src/PerseusR.so':
  /home/leonid/Documents/Programmation/PerseusR project/PerseusR/src/PerseusR.so: undefined symbol: _Z9lexicoPoslllRSt6vectorIlSaIlEE
Calls: suppressPackageStartupMessages ...  -> load_all -> load_dll -> library.dynam2 -> dyn.load
Execution halted

Exited with status 1.

It seems that the compilation is fine and there is a problem with the loading of some dynamic libraries. In the undefined symbol, lexicoPos is the name of a function in the c++ code.

Any ideas on how to solve this problem?

If your home-grown attempt fails, I suggest you start with a created example: Call Rcpp.package.skeleton() and compare all the files it creates with what you have.

Maybe you forgot the required line in NAMESPACE , maybe it is something -- we cannot tell from the information you supplied.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM