www.digitalmars.com         C & C++   DMDScript  
Archives

D Programming
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.ide
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger
D.gnu
D

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics


digitalmars.D.learn - Creating a dynamic link library

reply Fractal <supercode server.com> writes:
Hello

Using Windows, I created a DLL with D, and when I try to create my  test
executable (also with D), the ImpLib program displays an error saying that
there is no any exported function. The DLL source only contains a class with
the export attribute like:

export class Foo
{
}

And also... the GC can be implemented in the DLL and not in the executable?

Thanks
Jun 08 2009
next sibling parent Robert Clipsham <robert octarineparrot.com> writes:
Fractal wrote:
 Hello
 
 Using Windows, I created a DLL with D, and when I try to create my  test
executable (also with D), the ImpLib program displays an error saying that
there is no any exported function. The DLL source only contains a class with
the export attribute like:
 
 export class Foo
 {
 }
 
 And also... the GC can be implemented in the DLL and not in the executable?
 
 Thanks

I'm by no means an expert on the subject, but I know enough to say... DON'T DO IT! There's a huge wealth of issues that come from using DLLs and D, you'd be far better off using DDL ( http://www.dsource.org/projects/ddl ). Sorry I can't give a real reason for this, I'm not a windows user so couldn't care less about DLL's not working properly :P
Jun 08 2009
prev sibling parent Robert Fraser <fraserofthenight gmail.com> writes:
Fractal wrote:
 Hello
 
 Using Windows, I created a DLL with D, and when I try to create my  test
executable (also with D), the ImpLib program displays an error saying that
there is no any exported function. The DLL source only contains a class with
the export attribute like:
 
 export class Foo
 {
 }
 
 And also... the GC can be implemented in the DLL and not in the executable?
 
 Thanks

DLLs + D basically don't work (they work 100% if either only the host or only the extension is written in D, and then only for free functions with extern(C) linkage). For D-D shared libraries on Windows (which also work on Linux), I'd recommend checking out DDL: Documentation/homepage: http://www.dsource.org/projects/ddl Working code (fork): http://team0xf.com:8080/ext/file/94be291e4d32/ddl/
Jun 08 2009