Re: [S] dll.load and Digital Visual Fortran

Prof Brian D Ripley (
Thu, 23 Jul 1998 22:32:01 +0100 (BST)

On Thu, 23 Jul 1998, John Nolan wrote:

> I have developed some Fortran code using Digital Visual Fortran,
> which uses the Microsoft Developers Studio IDE. You can produce
> a 32-bit DLL with that compiler and link to it from S-Plus 4.5 on
> a PC running Win95 (and presumably Win98, WinNT). But I've
> still got two problems:
> 1. I have the DLL working on one PC (stand alone/not on a network
> with 64 MB RAM), but can not get it to run on another PC (again
> a Pentium PC, but with 32 MB RAM and connected to our ethernet).
> Specifically, when I do the dll.load("file") on the second PC,
> I get an error return of:
> -32: System is out of memory, or relocations were invalid.
> The exact same DLL and dll.load command works on machine
> one, but not on machine two. I cranked up the virtual memory
> on the second PC, thinking it would solve the problem, but it
> does not.
> Is this really a problem with not having enough physical memory,
> or what does a "relocation invalid" mean? Is it related to the
> second machine running Novell network??

As this also happens with dlls made with gcc compilers, I can give a clue.
The crucial call is LoadLibrary... to user32.dll, and that differs between
minor variants of Windows. We have a dll that will load on Windows 95, 95b
(OSR2), 95c (OSR2.5) and NT4.0sp3, but not 95a (service pack 1). And
another dll that will sometimes load (< 5%) on 95a. So there seems to be
something flaky in the implementations of dll relocation. (We got this
far as R built by gcc won't run on my machine, Windows 95a, although it
will run on most.)

The short answer is that you have to test dll's on each machine!
Enough to make one run back to Unix.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

----------------------------------------------------------------------- This message was distributed by To unsubscribe send e-mail to with the BODY of the message: unsubscribe s-news