DUB is a build tool for D projects with support for automatically retrieving dependencies and integrating them in the build process. The design emphasis is on maximum simplicity for simple projects, while providing the opportunity to customize things when needed.
Questions tagged [dub]
44 questions
12
votes
1 answer
Using dub to build documentation
How would I use dub to make DDocs from my source files? There appears to be no default command in dub to do this, and I'd really like to be able to automate this process.

Koz Ross
- 3,040
- 2
- 24
- 44
5
votes
1 answer
What are the optimization levels on D?
What's the ascending order for the dub to build optimized binary below? (e.g. ... debug < plain < release ...)
$ dub build -h
...
-b --build=VALUE Specifies the type of build to perform. Note that
setting the…

sof
- 9,113
- 16
- 57
- 83
5
votes
2 answers
Managing C dependencies with DUB
I was testing DUB and I wanted to install derelcitsdl2 with
"dependencies": {
"derelict-sdl2": ">=1.2.10"
}
But it immediately throws an runtime error when I run it. It tells me that it can't find the *.so files.
When I build a cross platform…

Maik Klein
- 15,548
- 27
- 101
- 197
4
votes
2 answers
Can I specify a min Dub or DMD version?
People keep trying to build my project with old versions of Dmd and Dub (0.9.2 instead of 1.0.0) and it does not work. Can I specify in the dub.json file the min required dub version?

Matthew Jones
- 372
- 2
- 11
4
votes
2 answers
How to add and run subPackages in Dub?
Project/
dub.sdl/
source/
examples/
test/
source/
app.d
dub.sdl
Project/dub.sdl
...
subpackage "./examples/test"
...
Project/examples/test/dub.sdl
name "test"
targetType "executeable"
If I try to execute dub run test…

Maik Klein
- 15,548
- 27
- 101
- 197
3
votes
2 answers
How do I make a configuration in DUB that turns multiple input D files with main functions into multiple output executables?
I can think of at least a few use-cases or scenarios for this:
An "examples" configuration that builds multiple example programs.
A project with a client program and a host program.
A project with one main program and some associated utility…

chadjoan
- 485
- 3
- 11
3
votes
1 answer
Is there a way to self-host a DUB registry?
I am building multiple projects for a client and they tend to have common code that I've factored out into separate projects. I'm trying to use DUB to organize all of this, but so far I can't figure out how to add these common projects as…

chadjoan
- 485
- 3
- 11
3
votes
1 answer
Configuring DUB to use 64-bit compiler
How do I configure DUB to compile my application as 64-bit executable? Here's my dub.json:
{
"name": "dvulkanbase",
"targetType": "executable",
"description": "Vulkan boilerplate",
"authors": ["Myself"],
"homepage":…

SurvivalMachine
- 7,946
- 15
- 57
- 87
3
votes
1 answer
DUB: Create two executable files with common code base
I need to generate two exe files that have some common source codes. What is the best way to do it with dub?
I tried to do like , but got error message about only one main function allowed.
Here is my dub.json:
{
"name": "code1",
"authors":…

Dmitry Bubnenkov
- 9,415
- 19
- 85
- 145
3
votes
2 answers
How do I convert dub.sdl into dub.json?
Since MonoD doesn't let me add use dub libraries natively I need to write dub.json myself. A good start would be to use an already existing template produced by e.g. dub init, but unfortunately this command produces a project that uses a competing…

Adam Ryczkowski
- 7,592
- 13
- 42
- 68
3
votes
2 answers
How to ignore warnings in 3rd party packages when building D project with DUB
I'm very new to D and DUB. I'm trying to build some examples, which use some 3rd party packages managed by DUB.
The problem is that one package generates some warnings. And it seems, that by default warnings are treated as errors. So, when 3rd party…

Dmitrii Semikin
- 2,134
- 2
- 20
- 25
3
votes
0 answers
Importing functions from C static library in D?
I have already converted static lib to OMF format, but still have message like:
.dub\build\application-debug-windows-x86-dmd_2066-1C1E0ED068478598700706764846CD8E\ftdi.obj(ftdi)
Error 42: Symbol Undefined _FT_Open
In program I have import…

Peter
- 123
- 1
- 6
3
votes
2 answers
DUB: How to specify version of git repo?
I use DUB, and want to include ncurses to project https://github.com/D-Programming-Deimos/ncurses/
it have not explicitly version specification on github page. But during build DUB ask me to specify version explicitly:
WARNING: A deprecated branch…

Suliman
- 1,469
- 3
- 13
- 19
3
votes
1 answer
How to add icon in D application?
I want to add icon to exe file of my application? How can I do it. I would like it's added automatically when I build my app with dub.

Suliman
- 1,469
- 3
- 13
- 19
2
votes
0 answers
How to link with static library from same dub file
I have a dub.json file that looks like:
{
"name": "myProject",
"configurations":
[
{
"name": "myLib",
"targetType": "staticLibrary",
"sourcePaths": ["myLibSrcDir"],
"importPaths":…

Mircea Ispas
- 20,260
- 32
- 123
- 211