r - 在 R 中获取 cpp 代码时,在构建共享库时发生错误 1
问题描述
我需要使用一些c++
代码来加快一些计算。为了做到这一点,我需要 Rtools。
我去了:https : //cran.r-project.org/bin/windows/Rtools/ 并安装了最新的稳定版本(Rtools35.exe(推荐))。安装似乎很好。
然后我find_rtools
从 package启动devtools
。在像这样的初始错误之后Rtools 与 R 版本 3.5.1 不兼容吗?由于那个答案,我设法解决了它。
现在find_rtools
返回TRUE
。
然后我尝试获取我的 cpp 代码,但仍然会弹出此错误:
C:/Rtools/mingw_64/bin/g++ -I"C:/Users/MARCO~1.FUM/DOCUME~1/R/R-35~1.0/include" -DNDEBUG -I"C:/Users/marco. fumagalli/Documents/R/R-3.5.0/library/Rcpp/include" -I"C:/Users/marco.fumagalli/CustomerNavigation/src/features" -O2 -Wall -mtune=generic -c bDist.cpp - o bDist.o 10 [main] make 20472 child_copy: stack write copy failed, 0x65ABA0..0x660000, done 0, windows pid 20472, Win32 error 5 482 [main] make 20472 fork: child 14912 - pid 14912, exitval 0x103, errno 11 制作:fork:资源暂时不可用 sourceCpp 中的错误(“src/features/bDist.cpp”):构建共享库时发生错误 1。尝试网址
然后它会弹出一个窗口说我需要一个 c++ 编译器(?!)。
正如此处指出的那样,Rcpp 找不到 Rtools:“在构建共享库时发生错误 1”我已经将建议的 bin 路径添加到 PATH 中。
我的 R 版本信息
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 5.0
year 2018
month 04
day 23
svn rev 74626
language R
version.string R version 3.5.0 (2018-04-23)
nickname Joy in Playing
我在 Windows 10 上。
谢谢
解决方案
推荐阅读
- python - Django OAuth 工具包 - 自省请求:“未提供身份验证凭据。”
- linux - 如何从源代码下载 Linux Mint 上的 Dark table
- javascript - 如何使用 Paypal 订阅发送自定义用户输入字段
- c++ - 在 macOS 上编译 Canon SDK
- java - 使用 Tomcat servlet 管理简单的 SQL Server 数据库表
- flutter - 如何在 Flutter 中构建合适的卡片?
- reactjs - 在我的 redux 存储数组中,我在 0 索引处有一个未定义的项目。我不确定它是怎么存在的?
- python - Python:来自 Json 的第一个对象
- java - 春季数据r2dbc更新
- html - 滚动边距顶部不适用于邮件布局