Thread overview
Should this work: export extern(C) auto ...
Mar 18, 2015
Robert M. Münch
Mar 18, 2015
Adam D. Ruppe
Mar 19, 2015
Robert M. Münch
Mar 19, 2015
Benjamin Thaut
Mar 20, 2015
Robert M. Münch
March 18, 2015
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

March 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.
March 19, 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

March 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:
>
>> 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.
March 20, 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