Export values (enum, int, char[]...) for DLL

torhu no at spam.invalid
Thu May 13 10:58:11 PDT 2010


On 13.05.2010 18:23, Nrgyzer wrote:
> Nrgyzer Wrote:
> dmd now exports all values successfully. But when I try to export a class, I get the following errors:
>
> "Error 42: Symbol Undefined _D5mydll1t7__ClassZ
> Error 42: Symbol Undefined _D5mydll1t5_ctorMFZC11mydll1t"
>
> Source of mydll.d is:
>
> export class t {
> 	
> 	export this();
> 	
> }
>
> Source of mydll2.d is:
>
> import std.stdio: writefln;
>
> export class t {
>
> 	export this() {
> 		writefln("hello world!");
> 	}
> }
>
> Source of test.d:
>
> pragma(lib, "mydll.lib");
> import mydll;
>
> void main() {
> 	
> 	t myTest = new t();
> 	
> }
>
> When I export D5mydll1t7__ClassZ in my def-File, I can compile it but when I try to create a new instance of t, I get an access violation :(.

Never tried exporting a class, but there's some info on this page:

http://prowiki.org/wiki4d/wiki.cgi?BestPractices/DLL


More information about the Digitalmars-d-learn mailing list