Linking D code into existing C programs

Basile B. via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 26 23:55:18 PDT 2016


On Monday, 26 September 2016 at 23:32:05 UTC, Walter Bright wrote:
> Linking C libraries and object code into D programs has always 
> worked easily in D. The other way around, not so well.
>
> [...]
> Produces:
>
>   bar.o:(.eh_frame+0x13): undefined reference to 
> `__dmd_personality_v0'
>   bar.o: In function `_D3bar7__arrayZ':
>   bar.d:(.text._D3bar7__arrayZ+0x21): undefined reference to 
> `_d_arraybounds'
>   bar.o: In function `_D3bar8__assertFiZv':
>   bar.d:(.text._D3bar8__assertFiZv+0x21): undefined reference 
> to `_d_assert'
>   bar.o: In function `_D3bar15__unittest_failFiZv':
>   bar.d:(.text._D3bar15__unittest_failFiZv+0x21): undefined 
> reference to `_d_unittest'
>   bar.o: In function `__d_dso_init':
>   bar.d:(.text.d_dso_init[.data.d_dso_rec]+0x28): undefined 
> reference to `_d_dso_registry'
>   collect2: error: ld returned 1 exit status
>
> How much of an issue is this with D? Is it something we need to 
> address?

This reminds me a huge clusterfuck encountered when trying to 
link an interfaced version of  libdparse in Object Pascal: 
http://forum.lazarus.freepascal.org/index.php/topic,32340.msg208499.html#msg208499

Soon or later this will happen again. But the next time the guy 
could completely give up and say "D is shitty".


More information about the Digitalmars-d mailing list