How to deploy single exe application (?)

Imperatorn johan_forsberg_86 at hotmail.com
Mon Nov 15 22:35:58 UTC 2021


On Monday, 15 November 2021 at 22:28:41 UTC, russhy wrote:
> On Monday, 15 November 2021 at 21:16:14 UTC, Willem wrote:
>> Using D -- I have created a simple command line utility that 
>> download some info via a https API and save it in a sqlite3 
>> database file. To use the exe on another windows machine, I 
>> need to copy over the relevant sqlite3 and curl DLL files.
>>
>> Question:  Is there a way to create a single .exe with the 
>> relevant windows DLL info in there? Can this be done with 
>> static linking?
>>
>> Any feedback / pointers on where to start would be greatly 
>> appreciated.
>>
>> Many Thanks, Willem
>
> you can statically link libraries just like in other languages
>
> if you use dub it's as easy as this:
>
> ```json
> "sourceFiles-windows": [
>     "../_clibs/glfw3.lib",
> ]
> ```
>
> if you use plain dmd, then it's simple
>
> ```
> dmd main.d mylib.lib
> ```

You are correct. But that only works if you got the static libs. 
If you only have the dynamic libs you have to resort to embedding 
them (if you don't want to ship them separately).


More information about the Digitalmars-d-learn mailing list