无法使用dyn.load windows 7 64bit在R中加载dll文件

时间:2014-02-09 17:56:33

标签: c++ windows r dll

虽然有人提出类似的问题但我似乎无法找到答案。我需要在C中包含C ++代码以加速我的算法。在我第一次尝试理解它是如何工作失败后,我正在关注this tutorial。我使用dev C ++,它应该有正确的编译器gcc(我知道我不应该使用虚拟C ++)并且已经成功地创建了他在1.3.2中讨论的.dll文件。但是,当我尝试在R(64位)中加载它时,我收到错误消息

  

inDL(x,as.logical(local),as.logical(now),...)出错:         无法加载共享对象'C:/Rpackages/Test/src/Xdemo.dll':         LoadLibrary失败:%1不是有效的Win32应用程序。

我从其他帖子中了解到,这可能是因为在我的路径中有一些调用32位应用程序。但是我删除了这些,但仍然得到相同的错误。我的道路:

  

C:\ Program Files \ R \ R-2.14.1 \ bin; C:\ Rtools \ bin; C:\ Rtools \ MinGW \ bin; C:\ Perl64 \ site \ bin; C:\ Perl64 \ bin ; C:\ Program Files(x86)\ MiKTeX 2.9 \ miktex \ bin; C:\ Program Files(x86)\ HTML Help Workshop; C:\ Program Files \ Common Files \ Microsoft Shared \ Windows Live; C:\ Program Files (x86)\ Common Files \ Microsoft Shared \ Windows Live; C:\ Program Files \ Intel \ WiFi \ bin \; C:\ Program Files \ Common Files \ Intel \ WirelessCommon \; c:\ Program Files \ WIDCOMM \ Bluetooth Software \; c:\ Program Files \ WIDCOMM \ Bluetooth Software \ syswow64; c:\ Program Files(x86)\ Common Files \ Roxio Shared \ DLLShared \; C:\ Program Files(x86)\ Windows Live \ Shared; C:\程序文件(x86)\ QuickTime \ QTSystem \; C:\ Users \ anne \ AppData \ Local \ Smartbar \ Application \; C:\ Users \ anne \ AppData \ Local \ Smartbar \ Application \

非常感谢一些帮助!

1 个答案:

答案 0 :(得分:0)

当我使用64位R时,路径位于...... R \ R-''''\ _ \ _ \ _ \ _ \ _版+ \ _ \ _ \ _ \ _ \ _(64而不是\ bin),问题就会消失。

尝试使用R --version进行确认。