"Nick Glencross" <[EMAIL PROTECTED]> wrote:
I've been giving some thought to what needs doing to get dynclasses
working on Windows. I'm not particularly intimate with Windows, but use
cygwin quite a bit.

I've also been looking at this, but for native Win32 rather than cygwin. I think they will be two slightly different cases, though I'm not that familiar with cygwin. So between us, we may be able to make it work on both. :-)

One area that I'm still not 100% clear about is the visibility of
symbols within DLLs and executables, so please be kind!
...
[My understanding is that] DLLs cannot have unresolved symbols, or at
least they must be linked against another DLL which can provide them.

As far as I can tell, the way it works on platforms that it does work on is that the "DLLs" call into functions in the parrot executable. So you kinda need to link against the parrot executable, or make sure your DLL refers to functions in the Parrot executable.

I played around with this idea today and managed to get it working for a simple test program. Please see here:-
http://www.jwcs.net/users/jonathan/cgi-bin/blog_read.pl?id=221

I'm pretty sure that by applying the same idea to Parrot I can get dynclasses working with MS VC++ with not too much effort.

The basic issue is, we need to identify every function that we wish to export from the Parrot executable that a dynpmc could call, and put their names in a parrot.def file. We don't have a -E (--export-dynamic) option like GCC (but doesn't cygwin use GNU ld too and thus have these flags too?).

I could use a few hints here from folks who know more about what to export and building such a list. I'm thinking that we have some functions within the Parrot core that we can just hardcode into a list becasue they won't change too often, and then we automatically pull in functions from all the headers that relate to built-in PMCs.

That said, I do like the idea (as shown by Nick) of building most of parrot.exe's stuff into a DLL, though don't know if it's required. I'm not sure I really understand where parrot_config.obj comes into all of this, though, so I'm very likely missing something on the cygwin front.

Input welcome,

Jonathan

Reply via email to