Undefined reference error at linktime with unittests

z z at z.com
Thu Dec 10 12:28:44 UTC 2020


When compiling with unit tests(via «dub test», or adding «dflags 
"-unittest"»), i'm getting this error at link time :

>lld-link: error: undefined symbol: 
>_D5packagename9subpackage9__mixin119type8toStringMFZAya
The same occurs with OPTLINK.

Curiously, looking at the incriminated .lib file with an 
hexadecimal editor reveals something odd:
>_D5packagename9subpackage9__mixin109type8toStringMFZAya
>>(the mangled name in the .lib is mixin109, but the linker is 
>>complaining that it cannot find a "mixin119" version of the 
>>symbol.)

Is there something i am doing wrong? I couldn't find 
documentation on what digits mean in mangled function names.


More information about the Digitalmars-d-learn mailing list