Building (and including libraries) without dub

drug via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Aug 26 03:02:03 PDT 2017


26.08.2017 12:03, Hasen Judy пишет:
> Building simple programs without dub is easy, just pass a list of .d 
> source files to `dmd` or `ldc2`.
> 
> What if I want to include a 3rd party library? Surely before dub 
> existed, people were incorporating other libraries in their projects.
> 
> I want to learn how this works from first principles. I've been working 
> with dynamic/interpreted languages for too long, I forgot what it's like 
> to build native programs without a dependency manager.
> 
> Any help would be appreciated!

It's like C++. If you use Linux then:
```
dmd <list of your .d files like you do> -L/path/to/lib 
-llibrarynamewithoutlibprefix
```
or example
```
dmd myapp.d -L../otherproject/lib -lcool
```
line above compiles `myapp.d` file and links it with library `libcool` 
that is place in directory `../otherproject/lib`


More information about the Digitalmars-d-learn mailing list