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
1
vote
0 answers
configure dflags for dependency in dub
I have a library that contains code compiled with dflags -fPIC. The library is a static one but get's linked into a (c++) shared library. So I need the -fPIC flag.
I can add the dflags to dub.json, but I add a dependency to a different library, the…

David Feurle
- 2,687
- 22
- 38
1
vote
1 answer
Linking with C libraries on Windows with Dub
I am trying to link glfw on windows.
On Linux it was fairly straight forward:
dependency "derelict-glfw3" version="~>2.0.0"
subConfiguration "derelict-glfw3" "derelict-glfw3-static"
sourceFiles "deps/glfw/build/src/libglfw3.a"…

Maik Klein
- 15,548
- 27
- 101
- 197
1
vote
1 answer
D: How to use binding to C++ lib with D?
I found very needed for my binding to lib named GDAL.
https://github.com/craig-dillabaugh/gdal
The problem that there is no examples of it's usage. Before I have never used any bindings.
dub.json include next string:
"libs" : ["gdal"]
So it seems…

Dmitry Bubnenkov
- 9,415
- 19
- 85
- 145
1
vote
1 answer
Is it's possible to link all libs statically in one exe?
Now my project in D have a lot of different libs. Is it's possible to link them statically and make single exe (the size is not problem).
Which command I should pass to DMD or is there any way to specify it's in DUB config?

Suliman
- 1,469
- 3
- 13
- 19
0
votes
1 answer
How do I pass build optimisation when using `dub run`?
Is it possible to use D's O optimisation when using dub run command line?
The package manager is absolutely fantastic, and just wondering if it is possible to pass along the following switches.
-O -release -inline -boundscheck=off

ikel
- 518
- 2
- 6
- 27
0
votes
1 answer
Having trouble with package.d
I am having trouble with D's package.d feature. I have my package.d file:
module dew;
public
import dew.util;
I then have util.d:
module dew.util;
struct Size
{
int width;
int height;
}
When I try to use it in another project, it gives…
user11494366
0
votes
2 answers
Why dub doesn't see the source folder?
I wanted to run my first project with dub. I initialized the project with dub init sandbox', then ran it with dub run. But dub said this:
Configuration 'application' of package sandbox contains no source files. Please add {"targetType": "none"} to…
user13922174
0
votes
2 answers
In DUB, how do I conditionally compile code based on optional dependencies?
If I have a DUB-based project with an optional dependency, how to I make it so that some code (be it modules or a version(...){...} block) only gets compiled if the dependency is chosen? Is there a way I can make a version identifier defined based…

chadjoan
- 485
- 3
- 11
0
votes
1 answer
In a DUB config file, how do I change the configuration (buildOptions) of a dependency?
Suppose I have a project called "myapp" and it depends on "sdlang-d". I want to build my project as release-debug, using dub build --build=release-debug from the command line. Due to SDLang issue #54, I can't have it build sdlang-d as…

chadjoan
- 485
- 3
- 11
0
votes
1 answer
D - module main is in file "main.d" which cannot be read when compiling using DUB
I have following for dub.json:
{
"name": "foo",
"targetType": "executable",
"sourceFiles": ["main.d"],
"mainSourceFile": "main.d",
"importPaths": ["src"],
"sourcePaths": ["src"],
}
I have my main.d (with basic…

Michail
- 1,843
- 1
- 17
- 21
0
votes
0 answers
Running `dub` on Raspberry Pi Zero W gives "Illegal Instruction"
On a fresh install of Raspbian on my Raspberry Pi Zero, I had attempted to install dub to build an application to see if it ran on this machine. I successfully installed gdc and downloaded and extracted the ARM version of dub from dlang.org. But,…

tinfoilboy
- 926
- 10
- 17
0
votes
1 answer
dlang how specify location of the external "C" library?
I'd like to use augeas on my Ubuntu. I've installed the libaugeas-dev apt package, that installed augeas.h file in /usr/include directory. Now I'd like to call some augeas functions.
The first one is augeas *aug_init(const char *root, const char…

Adam Ryczkowski
- 7,592
- 13
- 42
- 68
0
votes
1 answer
DMD looking for random file on disk when linking
About 20 minutes ago, I tried to compile a project of mine, and it compiled and linked fine into an executable. I added three D source files, edited some code, and tried to recompile. It failed. That in and of itself is nothing peculiar. However,…

Straivers
- 349
- 1
- 9
0
votes
0 answers
gumbo-d bindings with DUB
I'm trying to use gumbo-d in a project however dub is failing.
Here's the dub output:
Building: myproject (Default)
Performing main compilation...
dub build "myproject" "--build=plain"
Building package myproject in…

MattCochrane
- 2,900
- 2
- 25
- 35