How to build a static lib properly?

ryuukk_ ryuukk.dev at gmail.com
Mon Mar 6 02:49:18 UTC 2023


On Monday, 6 March 2023 at 01:57:21 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> On 06/03/2023 2:52 PM, ryuukk_ wrote:
>> Are you saying dub doesn't build a static dcd.lib?
>
> It did, but it doesn't contain any of the dependencies.
>
>> What to do to make it so i get a static dcd.lib file that 
>> contains all the code it needs?
>
> $ dub build --combined
>
> That may work. No guarantees. Dub isn't setup for distribution 
> like this.

combined didn't work, i still get a bunch of unresolved symbols 
(although less long):

https://gist.github.com/ryuukk/d59eb89979f1666139ffe0ac95307f20

there needs to be a better solution than to hunt down 
dependencies, then how to build the dependencies and to guess 
what version was used to build said dependencies for the whole 
tree of dependencies one project will use

this is very very poor design

the fact that this is apparently an issue for this long doesn't 
give me hope it's going to be solved anytime soon

if someone from the D team can build a usable static library for 
DCD and its dependencies, then please share to me how, something 
that doesn't involve playing a hunting game on github

that can't be worse than other languages, can it?


More information about the Digitalmars-d-learn mailing list