[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shared library on MinGW

From: Ralf Wildenhues
Subject: Re: Shared library on MinGW
Date: Tue, 14 Mar 2006 14:32:03 +0100
User-agent: Mutt/1.5.11

Hi John,

* John Pye wrote on Tue, Mar 14, 2006 at 02:18:04PM CET:
> Ralf Wildenhues wrote:
> >* John Pye wrote on Tue, Mar 14, 2006 at 06:26:31AM CET:
> >
> >>I just saw this thread and I have been experiencing similar problems.
> >>
> >
> >Well, if you have the same problem, then using `-no-undefined' should
> >fix it for you.  ;-)
> >
> No, according the the posting: '-no-undefined' means that "OUTPUT-FILE 
> does not depend on any other libraries."

Well, read the whole thread, and you'll know what I meant. :)

> My problem is the opposite: I know for sure that it *does* depend on 
> other libraries.

On other libraries that you did not specify on the link line.  Right?

> >>What I'm doing is running a DLL (_ascend.dll) via Python (wrapped with
> >>SWIG). This DLL in turn needs to load some of its own DLLs for external
> >>plugin code.

> >At runtime, right?  With LoadLibrary, or libltdl, or..?
> >
> The code that loads the plugins is at the link below. It's really old, 
> but I have been cleaning it up. On Windows the loading is done with 
> LoadLibrary. But this doesn't matter! My problem is that GCC on MinGW 
> won't let me compile my library with the unresolved symbols.


> >>The external plugin DLLs contain unresolved symbols that are present in
> >>_ascend.dll and are supposed to be resolved at load-time. The symbols
> >>are involving in 'registering' the plugin back with the main
> >>application, and providing error reporting capabilities.
> >>
> >>Under Linux this all works fine. Under Windows, I can't make libtool
> >>compile my library with these unresolved symbols.
> >
> >Right.  Just won't work that way on Windows, though.  You could factor
> >out all common code into a common library, for example.  Or factor the
> >common code into a plugin.  Or provide pointers for the callbacks.
> >
> I need you to clarify that last bit. Are you saying that I can't compile 
> a DLL with unresolved symbols that get resolved at LoadLibrary-time? 
> That is certainly what appears to be said on the edll page.

This is my understanding.  You can specify dependent DLLs.  But the need
to do this will prevent you from creating circles in the dependency chain.

> But it was my understanding from the libtool manual that this could be 
> accomodated by suitable settings with libtool. For example, section 9.1 
> makes no mention of *not being able to do anything in particular in 
> Windows. (In fact there are only a handful of mentions of 'windows', 
> 'win32' and 'cygwin' in the whole manual...). Ok, so maybe I was 
> dreaming. But maybe we could have some explanation of these issues in 
> the manual?

Yes, that would be good.  In fact, I think there is so little mention of
this because, back in the old times this issue was present on more
systems, so it was more known to people, and so did not deserve so much
mention.  This is speculation on my part, though.

> >I haven't tried the ideas listed on yet,
> >by the way.  If they work, libltdl may benefit from integrating some
> >of them (optionally).  If anybody has experience with them, I'd be
> >glad to learn about it.
> >
> It definitely sounds interesting. Otherwise I will have to go with some 
> kind of technique that passes some function pointers from my _ascend.dll 
> to my plugin DLL when it is being loaded. Which isn't so hard I guess.

Yes, for example.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]