简体   繁体   English

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

[英]Can't load a dll file in R using dyn.load windows 7 64bit

Although similar questions have been asked I can't seem to find the answer to mine. 尽管有人问过类似的问题,但我似乎找不到答案。 I need to include C++ code into R to speed up my algorithm. 我需要在R中包含C ++代码以加快算法速度。 After my first attempts of understanding how it works failed, I am following this tutorial . 在我第一次尝试理解它的工作方式失败之后,我正在学习本教程 I use dev C++ which should have the right compiler gcc(I learned that I should not be using virtual C++) and have succesfully created the .dll file that he is talking about in 1.3.2. 我使用的dev C ++应该具有正确的编译器gcc(我知道我不应该使用虚拟C ++),并且成功创建了他在1.3.2中讨论的.dll文件。 However when i try loading it in R (64bit) I get the error message 但是,当我尝试将其加载到R(64位)中时,出现错误消息

Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Rpackages/Test/src/Xdemo.dll': LoadLibrary failure: %1 is not a valid Win32 application. inDL(x,as.logical(local),as.logical(now),...)中的错误:无法加载共享对象'C:/Rpackages/Test/src/Xdemo.dll':LoadLibrary错误:%1不是有效的Win32应用程序。

I learned from other posts that this could due to the fact that in my path there is some calling to 32bit applications. 我从其他帖子中学到,这可能是由于在我的道路上有人对32位应用程序进行了调用。 However I removed these, but still get the same error. 但是我删除了这些,但仍然收到相同的错误。 My path: 我自己的路:

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:\\Program Files (x86)\\QuickTime\\QTSystem\\;C:\\Users\\anne\\AppData\\Local\\Smartbar\\Application\\;C:\\Users\\anne\\AppData\\Local\\Smartbar\\Application\\ 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:\\ Program Files( 86)\\的QuickTime \\ QTSystem \\; C:\\用户\\安\\应用程序数据\\本地\\ Smartbar \\应用\\; C:\\用户\\安\\应用程序数据\\本地\\ Smartbar \\应用程序\\

Some help would be really appreciated! 一些帮助将不胜感激!

When I use 64bit R, the path is under ...R\\R-'version'\\bin\\x64 (instead of \\bin) and the problem goes away. 当我使用64位R时,路径位于... R \\ R-'version'\\ bin \\ x64(而不是\\ bin)下,问题就消失了。

Try to use R --version to confirm. 尝试使用R --version进行确认。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM