dlang-tour / core

D Language online tour (https://tour.dlang.org/) and online editor (https://run.dlang.io/)
Boost Software License 1.0
115 stars 48 forks source link

No main generated by -main with dependencies #747

Closed jmh530 closed 4 years ago

jmh530 commented 4 years ago

For run.dlang.org, no main function is generated by the -main flag when there are dependencies.

This is likely related to issue 734 (i.e. perhaps all compiler flags aren't working with dependencies).

Consider

void foo() {}

compiled with -main has no error.

However, when compiling

/+dub.sdl:
dependency "automem" version="~>0.6.2"
+/
void foo() {}

with -main, then I get the error that

/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o:function _start: error: undefined reference to 'main'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
dmd failed with exit code 1.
jmh530 commented 4 years ago

Closed in favor of 748