简体   繁体   English

包编译动态库加载错误

[英]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. 我通过使用Rcpp在R中包装了一个小型c ++程序,并且事先检查了c ++代码是直接用g ++ 4.8.4编译的,没有警告或错误。 There are no external librairies, only STL is used. 没有外部库,仅使用STL。

When I compile my package in RStudio with devtools, I obtain the following error: 当我使用devtools在RStudio中编译我的包时,出现以下错误:


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. 在未定义符号中,lexicoPos是c ++代码中函数的名称。

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. 如果您尝试的本地尝试失败,建议您从创建的示例开始:调用Rcpp.package.skeleton()并将其创建的所有文件与您拥有的文件进行比较。

Maybe you forgot the required line in NAMESPACE , maybe it is something -- we cannot tell from the information you supplied. 也许您忘记了NAMESPACE的必填行,也许是这样-我们无法从您提供的信息中分辨出来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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