static int func(); int main() { return func(); } static int func() { return 0; }
Looking at the output of nm, you can see the function appears twice. 0000000000000000 t func U func 0000000000000000 W main
Fixed by https://github.com/dlang/dmd/pull/13399
The same code using -lib won't work: dmd file.c -lib Error: no definition for static func
it works with -lib on stable v2.099.1 but not current git master bisected it to https://github.com/dlang/dmd/pull/13846
Please don't reopen fixed bugs with different bugs. It makes the bug list unnecessarily hard to manage.
Closed and filed new issue https://issues.dlang.org/show_bug.cgi?id=23356