Total Newbie Q regarding compiling..

Daniel Keep daniel.keep.lists at gmail.com
Wed Mar 7 18:56:19 PST 2007



Chris Warwick wrote:
> I've only ever used integrated IDEs before so im a bit bemused as to how i 
> get multiple source files to compile into a single exe. I tried dmd + 
> sourcefilename but that always gives me an exe. I have the compiler instaled 
> ok, and i can compile a basic program, if it's just in a single file, do i 
> need a make file or a linker doing somthing or other to build multifile 
> projects??
> 
> thanks,
> 
> chris 

a.d:
----
import b;

void main()
{
    hi();
}

b.d:
----
import std.stdio;

void hi()
{
    writefln("Heeeeere's Johnny!");
}

Then compile and run like so:

> dmd a.d b.d
> a
Heeeeere's Johnny!

There are also several tools that will simplify this for you.  The most
used seem to be bud (www.dsource.org/projects/build) and rebuild
(http://www.dsource.org/projects/dsss/wiki/Rebuild).

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even
make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/


More information about the Digitalmars-d-learn mailing list