[dub] Building DLLs

Chris via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 29 08:49:42 PDT 2014


Today I tried to build a dll via dub, unfortunately I didn't 
succeed. I couldn't find much on the internet about it. Is it at 
all possible, and if yes, what's the config I have to use?

I tried this (and similar configs)

{
       "name": "myDLL32bit",
       "targetName": "myDLL.dll",
       "targetType": "dynamicLibrary", // Removed this too
       "targetPath": "bin/windows/32bit/dll",
       "platforms": ["windows"],
       "lflags": [
         "-L/IMPLIB",
         "-Llib/windows/32bit",
       ],
       "libs": [
         "somelibs ...",
       ],
       "sourceFiles-windows-x86-dmd": ["source/dll/myDLL.d", 
"source/dll/dllmain.d", "dll/32bit/myDLL.def"],
       "excludedSourceFiles": ["source/app.d"],
     }

I also included "mainSourceFile": "source/dll/dllmain.d", to no 
avail.

If I use a batch file, it works perfectly fine:

C:\D\dmd2\windows\bin\dmd.exe -ofbin\windows\32bit\dll\myDLL.dll 
-L/IMPLIB etc etc



More information about the Digitalmars-d-learn mailing list