https://issues.dlang.org/show_bug.cgi?id=16440
Andrej Mitrovic <andrej.mitrov...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|wrong-code |accepts-invalid CC| |andrej.mitrov...@gmail.com Hardware|x86_64 |All OS|Linux |All --- Comment #1 from Andrej Mitrovic <andrej.mitrov...@gmail.com> --- The problem is the compiler allows -c and -main. It will generate the D main function in a separate module but later when you try to link via `dmd test.obj` you won't be linking with this module. The workaround is simple, pass -main while linking: ----- dmd -c -oftest.o -unittest test.d dmd -main test.o ./test ----- In the meantime allowing -c and -main in the same invocation should be disallowed. --