[Rd] Finding windows DLLs

Duncan Murdoch murdoch at stats.uwo.ca
Mon Jan 7 21:00:08 CET 2008


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



More information about the R-devel mailing list