r - 错误:在 r 包开发中未加载 DLL 'mypackage.dll'
问题描述
我正在使用Rcpp
我的包函数中的循环加速。R Packages 书中的第 15 章说:
每当您在包中使用 C++ 代码时,您需要在卸载包时自行清理。通过编写一个卸载 DLL 的 .onUnload() 函数来做到这一点:
.onUnload <- function (libpath) {
library.dynam.unload("mypackage", libpath)
}
所以,我在我的包文件夹unload.R
中的文件夹中创建了一个文件,R
并将上面的代码放入其中。但现在我收到以下警告:
> checking whether the namespace can be unloaded cleanly ... WARNING
---- unloading
Warning message:
.onUnload failed in unloadNamespace() for 'carfollowingmodels', details:
call: library.dynam.unload("mypackage", libpath)
error: DLL 'mypackage.dll' was not loaded
> checking whether the namespace can be unloaded cleanly ... WARNING
---- unloading
Warning message:
.onUnload failed in unloadNamespace() for 'carfollowingmodels', details:
call: library.dynam.unload("mypackage", libpath)
error: DLL 'mypackage.dll' was not loaded
> checking compiled code ... NOTE
Note: information on .o files for i386 is not available
Note: information on .o files for x64 is not available
File 'C:/Users/umair/AppData/Local/Temp/RtmpiWZMKo/carfollowingmodels.Rcheck/carfollowingmodels/libs/i386/carfollowingmodels.dll':
Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
Found 'exit', possibly from 'exit' (C), 'stop' (Fortran)
Found 'printf', possibly from 'printf' (C)
File 'C:/Users/umair/AppData/Local/Temp/RtmpiWZMKo/carfollowingmodels.Rcheck/carfollowingmodels/libs/x64/carfollowingmodels.dll':
Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
Found 'exit', possibly from 'exit' (C), 'stop' (Fortran)
Found 'printf', possibly from 'printf' (C)
Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor use Fortran I/O
nor system RNGs. The detected symbols are linked into the code but
might come from libraries and not actually be called.
See 'Writing portable packages' in the 'Writing R Extensions' manual.
0 errors √ | 2 warnings x | 1 note x
我在这里想念什么?请注意,如果我不使用该unload.R
文件,我不会收到任何警告。但还是得到了笔记。
解决方案
推荐阅读
- android - 不要触发触发意图的同一应用程序的意图过滤器
- java - JBoss EAP 6.2:war-file 的交换 auth-method
- php - 如何在php中打印变量值?
- sql - SCCM 硬件报告 [如果有多个值(对于所有列)然后将它们组合在一起] 如何?
- php - 如何使用文件上传选项插入表单值
- javascript - 如何处理`UnhandledPromiseRejectionWarning`
- mongodb - go get mongo-go-driver 在 Dockerfile 中崩溃
- python - How to make `format` function in python 2 to work with `unicode` type objects with UTF-8 encoding?
- vue.js - 如何计算vuejs中的数字数组
- inno-setup - 在 Inno Setup 中显示消息后将焦点设置在编辑框上