workaround for `The module 'foo.bar' is already defined` when recompiling objects?

Timothee Cour via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 10 22:21:23 PDT 2017


```
dmd -shared -oflibfoo.so a1.d a2.d
dmd -ofmain -L-lfoo a2.d main.d
./main
```
gives runtime error: `The module 'foo.bar' is already defined in 'main'`

How would I work around this error?

Use case: allow partial recompilation of a binary without rebuilding
everything to optimize compile time for fast edit debug cycles.


More information about the Digitalmars-d mailing list