undefined reference to `const const(char)[] object.Throwable.message()

kdevel kdevel at vogtner.de
Tue May 17 18:43:26 UTC 2022


I am compiling some test code which dmd v2.100.and linking 
against a libdecimal.a compiled in March, probably compiled with 
dmd v2.099.0.

```
    $ dmd -g mytest.d decimal.git/libdecimal.a
```

Now the linker complains:

```
decimal.git/libdecimal.a(decimal_4f_a27.o):(.data._D7decimalQi25InvalidOperationException6__vtblZ+0x48): undefined reference to `_D6object9Throwable7messageMxFZAxa'
decimal.git/libdecimal.a(decimal_50_94f.o):(.data._D7decimalQi23DivisionByZeroException6__vtblZ+0x48): undefined reference to `_D6object9Throwable7messageMxFZAxa'
decimal.git/libdecimal.a(decimal_51_703.o):(.data._D7decimalQi17OverflowException6__vtblZ+0x48): undefined reference to `_D6object9Throwable7messageMxFZAxa'
decimal.git/libdecimal.a(decimal_52_765.o):(.data._D7decimalQi18UnderflowException6__vtblZ+0x48): undefined reference to `_D6object9Throwable7messageMxFZAxa'
decimal.git/libdecimal.a(decimal_53_67b.o):(.data._D7decimalQi16InexactException6__vtblZ+0x48): undefined reference to `_D6object9Throwable7messageMxFZAxa'
decimal.git/libdecimal.a(decimal_4e_65e.o):(.data._D7decimalQi16DecimalException6__vtblZ+0x48): more undefined references to `_D6object9Throwable7messageMxFZAxa' follow
collect2: ld returned 1 exit status
Error: linker exited with status 1
```

which demangles to

```
decimal.git/libdecimal.a(decimal_4e_65e.o):(.data.decimal.decimal.DecimalException.__vtbl+0x48): more undefined references to `const const(char)[] object.Throwable.message()' follow
```

When switching back to dmd v2.099.1 linking succeeds. Could not 
find any hint in https://dlang.org/changelog/2.100.0.html.


More information about the Digitalmars-d-learn mailing list