How to setup DLL and EXE projects in one VS solution

Igor via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 18 13:11:11 PDT 2017


On Thursday, 18 May 2017 at 18:00:02 UTC, Rainer Schuetze wrote:
>
> That's what I meant with "other cross module dependencies". In 
> this case it might work if you export 
> _D10handmade_h10game_input6__initZ from your DLL with the help 
> of a def-file, but that's not something that scales well.
>
> This talk will give you some details on the complications 
> involved: https://www.youtube.com/watch?v=MQRHxI2SrYM

Thanks for the link Rainer. I actually watched that a few days 
ago but it didn't help me understand what I just figured out. It 
slipped my mind that structs in D are not just structs like the 
ones in C. In D they have default initializer which is actually a 
function and as you said I am not exporting that function and it 
doesn't scale well to hunt all hidden functions that you need to 
export for all common datatypes. Even if I did, since I am 
loading DLL and its functions dynamically using GetProcAddress, 
how could I even tell D to use loaded function pointer as 
initialization function for a type...

Anyway I will stick with the solution of using a separate file 
where all common datatypes are defined in both projects and see 
how far I get with it.


More information about the Digitalmars-d-learn mailing list