Bug 18301 – `Error: no object files to link` when passing a ".a" instead of a ".o" => should be supported
Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2018-01-25T22:29:51Z
Last change time
2023-05-05T13:17:19Z
Assigned to
No Owner
Creator
Timothee Cour
Comments
Comment #0 by timothee.cour2 — 2018-01-25T22:29:51Z
seems like an un-necessary restriction:
dmd -c main.d
dmd main.o #ok
dmd -lib main.d
dmd main.a #Error: no object files to link
Can that be supported?
NOTE: a workaround is to add an empty `dummy.d`:
dmd main.a dummy.d
Comment #1 by razvan.nitu1305 — 2023-05-05T13:17:19Z
What would be the result of this? Normally you link a library with your code. If you simply pass a library to the compiler what should the compiler do? Most libraries (if not all) don't have a main function so what is the compiler supposed to do if you provide it with a library?
I think that this behavior should not be supported.