我可以在R中加载第三方.dll吗? [英] Can I load a third-party .dll in R?
问题描述
我正在运行Windows 7,并且我知道DLL是使用Visual Studio C ++ 2010构建的。由于我没有源代码,因此在创建程序包时无法在R中即时构建它(NAMESPACE) )。 在这个阶段,我不需要创建包,我只想使用 dyn.load()
在R中加载库。由于它是一个dll,我想它可以移植到任何客户端程序中,但是我可以确定,因为我知道它不是使用 GNU gcc
编译的。
I am running Windows 7, and I know the DLL was built using Visual Studio C++ 2010. Since I don't have the source code I can't build it on-the-fly in R when creating a package (NAMESPACE). At this stage, I don't need to create a package, I just want to load the library in R using dyn.load()
. Since it is a dll I suppose it is portable to any client program, but I would just make sure, because I know that it was not compiled using GNU gcc
.
编辑:
我想调用dll部署的所有功能。
I want to call all the functions that the dll deploys.
推荐答案
是的,R可以使用 dyn.load
加载它。但是,您可能实际上无法调用它导出的函数。除非函数的参数与R可以处理的参数相对应,否则它们将不可用。在这种情况下,您可以编写一个包装器dll,充当它和R之间的转换层。
Yes, R can load it using dyn.load
. You may or may not be able to actually call the functions it exports, though. Unless the functions' arguments correspond to what R can handle, they won't be usable. If this is the case, you can write a wrapper dll that acts as a translation layer between it and R.
这篇关于我可以在R中加载第三方.dll吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!