How to setup DLL and EXE projects in one VS solution
solidstate1991 via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed May 17 10:48:50 PDT 2017
On Wednesday, 17 May 2017 at 16:56:13 UTC, Igor wrote:
> At the moment I have:
>
> EXEProject:
> app.d - it does loadlibrary of dllproj and uses data
> structures defined in dllproj.d (it imports dllproj). On the
> file system this file is under <solutiondir>/platform/win32/
> and is defined as module win32.app;
>
> DLLProject
> dllproj.d - exports functions and contains data structures
> those function use. On file system this file is under
> <solutiondir>/source and is defined as module dllproj;
>
> EXEProject depends on DLLProject. DLL project compiles and
> builds DLL fine but, of course EXE project breaks with an error:
>
> module dllproj is in file dllproj.d which cannot be read.
>
> I could just copy all the structs from dllproj.d to app.d and
> remove the import and I guess it would all work but there has
> to be a better way to structure code so structs are only
> written in one place?
I think you should make a binding for your DLL file. On the other
hand I successfully set up a static library and an application in
the same solution (now it has 2 apps, one is my map editor and
file converter, the other is a window layout editor, going to add
a third one for testing other functions later on) by adding the
engine's sources and library files to the app.
More information about the Digitalmars-d-learn
mailing list