How to setup DLL and EXE projects in one VS solution

Igor via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 17 12:48:42 PDT 2017


On Wednesday, 17 May 2017 at 18:03:04 UTC, Igor wrote:
> What exactly do mean by "binding"?
>
> If I understand the rest you are saying that I could just use 
> "Add existing item" to add the dllproj.d file to EXEProject as 
> well, but that would cause all of the code from it to be linked 
> in the EXE and I only want that code in the DLL.
>
> I should also mention that I don't want to statically bind to 
> DLL using a lib file because I want to be able to reload the 
> DLL while the application is running.

I managed to get it to work by extracting all common structs to 
dllprojInterface.d module that sits at 
<solutionDir>/source/dllprojInterface.d on the file system but is 
added to both projects in the solution.

I am still wondering if there is a better solution?

Also I am wondering if using extern(C) as opposed to extern(D) 
only affects name mangling or am I losing some DLang 
possibilities since I am only calling DLang DLL from DLang EXE?


More information about the Digitalmars-d-learn mailing list