digitalmars.D.learn - Should this work: export extern(C) auto ...
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (14/14) Mar 18 2015 Windows, 32-Bit, DLL:
- Adam D. Ruppe (4/6) Mar 18 2015 It will not work because a function with an auto return value is
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (6/8) Mar 19 2015 Ok, that makes it clear. Thanks.
- Benjamin Thaut (4/9) Mar 19 2015 Generally don't expect to many things to work with DLLs at the
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (10/13) Mar 20 2015 I prefer dead-old-style plain & simple C functions in DLLs with a super
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
Mar 18 2015
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.
Mar 18 2015
On 2015-03-18 21:50:39 +0000, 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
Mar 19 2015
On Thursday, 19 March 2015 at 12:58:42 UTC, Robert M. Münch wrote:On 2015-03-18 21:50:39 +0000, Adam D. Ruppe said: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.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.
Mar 19 2015
On 2015-03-19 13:22:44 +0000, 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
Mar 20 2015