Skip to content

dyn.unload

2 messages · Christian Hennig, Brian Ripley

#
Dear list,

I want to write a package which loads a C library dynamically.

It seems that it is not possible to unload the library using dyn.unload
(for example with detach, .Last.lib)
if it has been loaded with library.dynam in .First.lib.

dyn.unload in my experience only unloads libraries
successfully which have been loaded by dyn.load.

So how to unload libraries which were loaded in .First.lib (dyn.load seems
to be discouraged for .First.lib)?

Christian
#
On Wed, 6 Feb 2002, Christian Hennig wrote:

            
And as library.dynam calls dyn.load, that includes those loaded by
library.dynam!  Are you calling dyn.unload with the correct argument?
There is a working example in library(tcltk) under Windows.  You need
also to remove the entry in .Dyn.libs for library.dynam to work on
the same package again.