From murdoch at stats.uwo.ca  Mon Jan  7 21:00:08 2008
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Mon, 07 Jan 2008 15:00:08 -0500
Subject: [Rd] Finding windows DLLs
In-Reply-To: <6phy7b12z44.fsf@gopher4.fhcrc.org>
References: <6phy7b12z44.fsf@gopher4.fhcrc.org>
Message-ID: <478284C8.1040203@stats.uwo.ca>

On 1/7/2008 2:51 PM, Martin Morgan wrote:
> The XML package relies on libxml2.dll (e.g., bundled with the CRAN
> binary) installed in library/XML/libs. Unfortunately,
> c:/WINDOWS/system32/libxml2.dll will be found and loaded before
> this.
> 
> Is there any programatic solution?

Search order for DLLs is version dependent on Windows.  The best way to 
be sure of what you're loading is to fully specify the path to the DLL, 
and this generally requires you to use API calls LoadLibrary() and 
GetProcAddress() rather than relying on automatic loading of dependencies.

I don't know how many entry points XML is importing from libxml2.dll; if 
there are a lot, LoadLibrary() will be a pain to use, and it might be 
easiest to rename libxml2.dll and hope to avoid a collision.

Duncan Murdoch



[Rd] Finding windows DLLs
Duncan Murdoch