[R] error message %1 is not a valid Win32 application.

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri May 27 08:12:52 CEST 2011


On Thu, 26 May 2011, Duncan Murdoch wrote:

> On 11-05-26 9:11 PM, sivan aldor wrote:
>> I ran the exact command this morning on a friend's computer which is
>> 32bit and it worked!
>> I am now running it from a different computer. As far as I can tell the
>> only difference is that his OS is VISTA and mine is Windows 7. Can that
>> really be the problem?!?!
>
> What makes you think the file got copied properly to the different computer?
>
> By the way, I've looked at the code, and it doesn't appear to be worth the 
> trouble to replace that %1, because dyn.load() is platform-neutral, while the 
> message only has that format in Windows.  The full error message (which it 
> would have helped if you'd shown) is something like:
>
> unable to load shared object 'D:/stuff/junk.dll':
> LoadLibrary failure:  %1 is not a valid Win32 application.
>
> The %1 is just the file listed on the previous line.

Usually Microsoft gives more information in a popup.  But we cannot be 
held responsible for Microsoft's arcane error messages.   Note that 
they give that message not only if junk.dll cannot be loaded, but also 
if some DLL on which junk.dll depends cannot be loaded.  As I said, in 
XP or later (but not 2000) there should be a popup message box with 
the details.

It this works on 32-bit R on one computer and not another, the most 
likely explanation is that a dependent DLL is missing.  We recommend
'Dependency Walker' (www.dependencywalker.com) for a GUI-based program 
to examine such issues.

>
> Duncan Murdoch
>
>> 
>> On Thu, May 26, 2011 at 9:05 PM, Duncan Murdoch
>> <murdoch.duncan at gmail.com <mailto:murdoch.duncan at gmail.com>> wrote:
>>
>>     On 11-05-26 8:42 PM, sivan aldor wrote:
>>
>>           The only command I am using is
>>         dyn.load("dbsvls.dll")
>> 
>>
>>     Okay, I get the error message you showed if I try to load something
>>     that really isn't a valid Win32 dll, and I don't get it when I load
>>     a valid one.  (I'm not sure if I can fix it to replace the %1 with
>>     the filename; I'll look into that.)  How do you know your dbsvls.dll
>>     really is valid?
>>
>>     Duncan Murdoch
>> 
>> 
>> 
>> 
>>
>>         On Thu, May 26, 2011 at 8:41 PM, Duncan Murdoch
>>         <murdoch.duncan at gmail.com <mailto:murdoch.duncan at gmail.com>
>>         <mailto:murdoch.duncan at gmail.com
>>         <mailto:murdoch.duncan at gmail.com>>> wrote:
>>
>>             On 11-05-26 4:53 PM, sivan aldor wrote:
>>
>>                 Hi Everyone,
>>                 I am trying to work with a routine that is from the IMSL
>>         called
>>                 BSVLS. I
>>                 have the file as a .dll file.
>>                 I have been trying to call the routine using  the dyn.load
>>                 function. I am
>>                 working on a 32-bit windows 7 OS with 3 GB. For some
>>         reason i
>>                 still keep
>>                 getting the error message
>>
>>                 LoadLibrary %1 is not a valid Win32 application
>>
>>                 I looked at previous posting and they were all related
>>         to people
>>                 trying to
>>                 run dll files that was created under 64bit and not under
>>         32bit.
>>                 But I am
>>                 running it on the correct settings.
>>
>>                 I have placed the .dll file in the BIN folder so R can
>>         find it.
>>
>>                 Any thoughts? ideas on how I should handle this?
>> 
>>
>>             Why don't you tell us what you did?
>>
>>             Duncan Murdoch
>> 
>> 
>> 
>> 
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list