www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D and DLL creation

reply "me" <memsom interalpha.co.uk> writes:
I was looking at D with great excitement a few days ago. It looks to be
something I'd like to tinker with within Windows and possibly BeOS (though
getting a compiler would be an interesting feat as BeOS is still stuck in
the GCC 2.95 world) however, I want to make DLL's with D. So here are some
questions:

How do I go about exporting classes? Is that possible yet?
How does one import DLL's with the current toolset? I saw a reference to an
implib tool, where do I get this from? Is the Borland version a usable
alternate? (as iirc Borland use OMF)

TIA

Matt
Jun 21 2004
parent reply Lars Ivar Igesund <larsivar igesund.net> writes:
me wrote:

 I was looking at D with great excitement a few days ago. It looks to be
 something I'd like to tinker with within Windows and possibly BeOS (though
 getting a compiler would be an interesting feat as BeOS is still stuck in
 the GCC 2.95 world) however, I want to make DLL's with D. So here are some
 questions:
 
 How do I go about exporting classes? Is that possible yet?
export class Foo {}
 How does one import DLL's with the current toolset? I saw a reference to an
 implib tool, where do I get this from? Is the Borland version a usable
 alternate? (as iirc Borland use OMF)
You have a couple of possibilities: Use the loader module of Phobos to dynamically load dlls or make an import library (either download bup.zip from digitalmars or use the /IMPLIB switch when linking the dll). Lars Ivar Igesund
Jun 21 2004
parent reply "me" <memsom interalpha.co.uk> writes:
 How do I go about exporting classes? Is that possible yet?
export class Foo {}
Cool, I'll try that later.
 You have a couple of possibilities:

 Use the loader module of Phobos to dynamically load dlls
That's one to look into at a later date ;-)
or  make an import library (either download bup.zip from digitalmars or use
 the /IMPLIB switch when linking the dll).
The /IMPLIB didn't work for me, but the bup package worked like a charm. The implib works pretty much as I remember the old Borland one did. Right, back to the day job (Delphi..) Matt
Jun 21 2004
parent reply Lars Ivar Igesund <larsivar igesund.net> writes:
me wrote:

 The /IMPLIB didn't work for me, but the bup package worked like a charm. The
 implib works pretty much as I remember the old Borland one did.
Sorry, it should be /implib (small letters). Lars Ivar Igesund
Jun 21 2004
parent Charlie <Charlie_member pathlink.com> writes:
I have yet to get this to work, always says missing __Class definition, has
anyone gotten this to work ... and then _link_ against the generated stub ?

Charlie

In article <cb6ff8$pd4$1 digitaldaemon.com>, Lars Ivar Igesund says...
me wrote:

 The /IMPLIB didn't work for me, but the bup package worked like a charm. The
 implib works pretty much as I remember the old Borland one did.
Sorry, it should be /implib (small letters). Lars Ivar Igesund
Jun 21 2004