Thanks VSarkiss. I had kind of realised that this was the problem, but had thought maybe there was a way to tell DynaLoader where to look for the library. I even checked the doco and found an array that DynaLoader uses for this purpose, but couldn't get it to do what I want. I suspect that even in this case it is, as you say, too late.
In any case, herveus's solution works and I'm happy.