Instructions for compilation from multiple source files

Solomon E via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 10 04:10:36 PST 2014


I wanted to know how to compile a D program that has multiple
source files. I looked under "Modules" in the language reference,
but there isn't anything there about compilation, or anything
about where to put the source files, or anything about how the
compiler finds the files to use.

I'm currently using the GDC compiler, because I don't trust the
DMD Debian package enough to install it, considering it has
Google adsense ads in its HTML pages, which is against even
Google's policy.

I looked around the D Wiki for instructions on compilation, and
it doesn't seem that there are any instructions other than for
DMD on Windows and for compiling a hello world with one source
file. The GDC site has no instructions or documentation on how to
do compilation.

The GDC man page is the same as the GDC info page. It lists some
options for the compiler without listing what they do in the case
of D.

I'm not getting any .o or .a files out of the compiler, only
a.out or whatever file name I choose with the -o option.

I don't want to have to guess how to do it and experiment, as if
it's all implementation defined and in flux to the degree that
that's the only way to compile anything.

If there aren't instructions or documentation on how to compile
more than one file into a finished D runnable project in a
correct way that can grow with larger projects, then I'll have to
take it as implied that D is just not ready or not welcoming and
I shouldn't use it.


More information about the Digitalmars-d-learn mailing list