Using a betterC dub package in ordinary D

Ferhat Kurtulmuş aferust at gmail.com
Fri Jan 8 18:28:36 UTC 2021


On Friday, 8 January 2021 at 15:40:12 UTC, Bastiaan Veelo wrote:
> Hi,
>
> When I use earcutd [1] in an ordinary D project, I get a link 
> error for the __D7earcutd12__ModuleInfoZ symbol. This is 
> because the earcutd dub.json has `"dflags": ["-betterC"]`. I 
> think this is in error, my understanding of betterC code is 
> that it can be compiled with "-betterC", but does not need to 
> (and must not when used in D context).
>
> Am I right? What are the best practices for betterC dub 
> packages?
>
> Thanks,
> Bastiaan.
>
>
> [1] https://code.dlang.org/packages/earcutd

Dear Bastiaaan,

I am not an expert in dub system, but I have just pushed a 
modification in dub.json. I am not sure if it solves your 
problem. My modification is

     "configurations": [
         {
             "name": "default",
             "targetType": "library"
         },
         {
             "name": "betterC",
             "targetType": "library",
             "dflags": ["-betterC"]
         }
     ]

now client projects must explicitly pass the subConfiguration 
parameter to compile it with betterC.


More information about the Digitalmars-d-learn mailing list