www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - [dub] Building DLLs

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": [
       "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 

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
Sep 29 2014