Importing local modules in C style

jmh530 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 25 10:20:44 PDT 2015


On Thursday, 25 June 2015 at 14:37:28 UTC, Binarydepth wrote:
>
> I organize some exercises in some source files, it's more how I 
> like to work with C. I'm used to organize source files this way 
> and I was wondering if this was possible with D.
>

If the files are in the same folder, just import local; in the 
main.d file and then run dmd main.d from the command line. You 
might need to ensure that there is only one main function.

If the files are in different folders, you have to use a -I to 
the folder that contains local.d.

I would recommend familiarizing yourself with Dub. It may make 
your life easier.


More information about the Digitalmars-d-learn mailing list