CTFE in .di files

Manu turkeyman at gmail.com
Thu Apr 19 01:09:53 UTC 2018


On 18 April 2018 at 08:10, Stefan Koch via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Tuesday, 17 April 2018 at 22:19:19 UTC, Manu wrote:
>>
>> I've been having some problems like this:
>> https://issues.dlang.org/show_bug.cgi?id=18774
>>
>> I have .di files with mixins that generate declarations using CTFE.
>> Trouble is, executing the CTFE seems to leave residual references to
>> symbols which result in unresolved link errors in the client of the
>> .di file.
>> This seems wrong to me. CTFE shouldn't leave residual dependencies on
>> runtime symbols... is this a well-known issue? Are there common
>> workarounds?
>>
>> I'm surprised I haven't run into this before... I must have just luckily
>> managed to avoid the specific problem structure.
>
>
> stick an empty extern(C) function into your module with the name the linker
> complained about.

You sly dog! :P


More information about the Digitalmars-d mailing list