www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Dll Export

How can I export classes in a dll?

I did a quick test on the mydll sample but it didn't work

In mydll2.d file I defined the class

    export class MyClass {
                void print() { printf("Hello\n"); }

in mydll.d file I added

        export class MyClass;

In the test.d file there's import mydll.d

MyClass cl = new MyClass();

the compiler gives the following error msg:
mydll.d(2): class MyClass is forward referenced when looking for 'print'
what's wrong??
Oct 03 2004