Re: Should this work: export extern(C) auto ...
On 2015-03-19 13:22:44 +, Benjamin Thaut said: Generally don't expect to many things to work with DLLs at the moment. Hi, well, I think what's available is good enough to get most things done. Generally speaking only exporting global functions works. Don't try to export classes / structs or anything fancy. I prefer dead-old-style plain & simple C functions in DLLs with a super simple interface based on basic types. Works bests, is stable, can be maintained and is easy to use. So, no fancy stuff needed in my case :-) -- Robert M. Münch http://www.saphirion.com smarter | better | faster
Re: Should this work: export extern(C) auto ...
On Thursday, 19 March 2015 at 12:58:42 UTC, Robert M. Münch wrote: On 2015-03-18 21:50:39 +, Adam D. Ruppe said: It will not work because a function with an auto return value is actually a template, and unused templates won't be put into a dll. Ok, that makes it clear. Thanks. Generally don't expect to many things to work with DLLs at the moment. Generally speaking only exporting global functions works. Don't try to export classes / structs or anything fancy.
Re: Should this work: export extern(C) auto ...
On 2015-03-18 21:50:39 +, Adam D. Ruppe said: It will not work because a function with an auto return value is actually a template, and unused templates won't be put into a dll. Ok, that makes it clear. Thanks. -- Robert M. Münch http://www.saphirion.com smarter | better | faster
Re: Should this work: export extern(C) auto ...
On Wednesday, 18 March 2015 at 15:50:16 UTC, Robert M. Münch wrote: struct1 is visible in the DLL, struct2 is not visible in the DLL. It will not work because a function with an auto return value is actually a template, and unused templates won't be put into a dll.
Should this work: export extern(C) auto ...
Windows, 32-Bit, DLL: export extern(C) struct1 struct1(){ struct1 x; return(x); } export extern(C) auto struct2(){ struct1 x; return(x); } struct1 is visible in the DLL, struct2 is not visible in the DLL. -- Robert M. Münch http://www.saphirion.com smarter | better | faster