Why is DUB not passing dll.def file to linker

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 21 03:15:40 PDT 2017


On Sunday, 21 May 2017 at 09:37:56 UTC, Igor wrote:

> If I now run dub build in main project both projects compile 
> and work together, but if I run dub build -ax86_64 only main 
> project is built as 64bit while dll project is still being 
> built as 32bit. Does anyone have a suggestion how can I make 
> this work for both architectures?

You'll need to pass -ax86_64 in your preBuildCommands. You could 
set up separate configurations.

What's the issue with using the DLL project as a dependency? 
Assuming the following layout:

-project
-- dllProject
-- exeProject

You should be able to add a copyFiles directive to the dllProject 
configuration that will copy the DLL to the output directory of 
anything that depends on it.

"copyFiles" : ["dllProject.dll"]

Then you can add the following to exeProject/dub.json:

"dependencies": {
     "dllProjectName": {"path" : "../dllProject" }
}

I would expect the import lib to be linked automatically. This 
should ensure the dll is compiled with the same architecture as 
the exe.


More information about the Digitalmars-d-learn mailing list