On Fri, Jan 17, 2020 at 04:12:18PM -0800, Ali Çehreli via Digitalmars-d-learn wrote: > On 1/17/20 3:04 PM, Petar Kirov [ZombineDev] wrote:> On Friday, 17 January > 2020 at 21:40:05 UTC, JN wrote: > > > I think the problem comes from the way you compile and link your > > code. I you compile both modules together like this it should work > > out: > > > > dmd -ofresult main.d stuff.d > > If that's the solution, some people may find a relatively less known > dmd command line switch useful: -i: > > -i[=<pattern>] include imported modules in the compilation [...]
Yeah, -i has been a super-convenient thing to use. For unittesting individual modules, etc., I can just `dmd -i -unittest -main -run module.d` and it Just Works(tm). It's awesome. Highly recommended. T -- A programming language should be a toolbox for the programmer to draw upon, not a minefield of dangerous explosives that you have to very carefully avoid touching in the wrong way.