Making .exe
Dlearner via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Jan 19 13:47:53 PST 2017
On Thursday, 19 January 2017 at 20:56:41 UTC, Nemanja Boric wrote:
> On Thursday, 19 January 2017 at 18:58:31 UTC, Dlearner wrote:
>> [...]
>
> Hello!
>
> The binary should be in the working directory:
>
> ```
> ➜ dub init
> Package recipe format (sdl/json) [json]:
> Name [test-dub]:
> Description [A minimal D application.]:
> Author name [Nemanja]:
> License [proprietary]:
> Copyright string [Copyright © 2017, Nemanja]:
> Add dependency (leave empty to skip) []:
> Successfully created an empty project in
> '/home/burgos/work/test-dub'.
> Package sucessfully created in .
> ➜ echo 'import std.stdio;\nvoid main() { writeln("Hello!");
> }' > source/app.d
> ➜ dub --build=release
> Performing "release" build using dmd for x86_64.
> test-dub ~master: building configuration "application"...
> Linking...
> Running ./test-dub
> Hello!
> ➜ ./test-dub
> Hello!
> ➜ ll
> total 820K
> -rw-rw-r-- 1 burgos burgos 168 Jan 19 21:53 dub.json
> drwxrwxr-x 2 burgos burgos 4,0K Jan 19 21:52 source
> -rwxrwxr-x 2 burgos burgos 811K Jan 19 21:53 test-dub <- the
> executable
> ```
>
> You can ommit --build=release - this makes a "release mode"
> binary (without assertions and bounds check), which is a faster
> & smaller version of the binary, but with less sanity checks.
Yo!
Okay I did this and I run the .exe and it works, but if I try to
copy/paste it on my desktop and run it, it (obviously) doesn't
work. Is there a way to somehow compile the source, .dll's and
image file that I'm using together into one executable?
More information about the Digitalmars-d-learn
mailing list