Using D static library from C

George Sapkin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 5 18:20:16 PDT 2014


On Thursday, 5 June 2014 at 19:14:34 UTC, Stefan Koch wrote:
> On Thursday, 5 June 2014 at 19:00:24 UTC, George Sapkin wrote:
>> On Thursday, 5 June 2014 at 18:55:13 UTC, Stefan Koch wrote:
>>> You need to link the druntime too, I think.
>>
>> At which stage? Can you provide a full command? Thanks.
>
> Err ... I just remeberd linking d with gcc needs a few libs
> -lpthread -lc -lm and possiby more
> though I use gdc I don't know what dmd links by default
> try to make an object file with gcc and link with dmd

I can link a D object (not a static lib) with gcc using -lphobos2
and that works. So additional libs does not solve anything. The
trouble is linking a static lib without causing a segfault.


More information about the Digitalmars-d-learn mailing list