separate and/or independent compilation

BCS ao at pathlink.com
Thu Jun 7 20:59:21 PDT 2007


Reply to Tibi,

> Can someone please tell me a few words about separate compilation in
> D. A small example would be nice, if I`m not asking too much.
> 
> And one more thing, I haven`t understood very well what import does,
> is it similar to the #include statement from C++ or is it somewhat
> different?
> 

to compile a file and not link it use -c

dmd -c myfile.d

to link several object files uses your linker

on linux

gcc a.o b.o c.d -<needed flags>    // the flags can be found by calling dmd 
with a hello world and watching the output to stdout

on win32 it is about the same but the linker you will need to use in in dm/bin/link.exe 
and I don't remember how to get the args. OTOH if you call DMD with only 
object files, in win32 or linux it will link them




More information about the Digitalmars-d-learn mailing list