c++ - 将 Rcpp 与 boost/regex 一起使用,eval(expr, envir, enclos) 错误 : object 'libboost_regex' not found

标签 c++ r boost rcpp

当使用带有 boost/regex 的 Rcpp 时,Build&reload 显示

Error in eval(expr, envir, enclos) : object 'libboost_regex' not found

错误:无法加载“genia”包中的 R 代码 错误:包“genia”的延迟加载失败

我已经设置了

Sys.setenv(PKG_LIBS="-L/Users/name/software/cpp_boost/lib -lboost_regex")
Sys.setenv(PKG_CPPFLAGS="-I/Users/name/software/cpp_boost/include -I../inst/include")

但是,使用 sourceCpp(),没关系。我想知道如何解决这些问题。

最佳答案

将 Boost 与库一起使用在 this full example 中有效来自 Rcpp Gallery .

我建议您从复制该示例开始——只需对保存到文件中的代码调用 sourceCpp()——然后​​从那里开始。

关于c++ - 将 Rcpp 与 boost/regex 一起使用,eval(expr, envir, enclos) 错误 : object 'libboost_regex' not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30058819/

相关文章:

c++ - Boost::log:基于级别的不同格式(HTML 格式)

c++ - 为什么 Boost Variant 使用模板构造函数而不是 boost::beast::websocket::stream 的移动构造函数?

r - 如何检查 R 是否已经安装在 Ubuntu 中?

r - 如何匹配以逗号分隔的两个列元素

c++ - 在 MSVC 11 中 boost "destructor is not virtual"错误

C++:迭代器适配器将迭代器限制在一系列迭代器中?

c++ - 是否可以使用三元来切换/控制/预测成员函数调用?

c++ - 在 Qt/C++ 中获取 QProcess 的可执行文件名称

c++ - 删除结构数组时 VS 2010 C++ 崩溃

r - igraph中的可变顶点字体大小