Using the -I flag in Linux

Derek Parnell derek at psych.ward
Thu Dec 27 13:25:59 PST 2007


On Thu, 27 Dec 2007 19:35:47 +0100, "Jérôme M. Berger" wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> PaperPilot wrote:
>> Steven Schveighoffer Wrote:
>> 
>>> You need to include the object file that Word produced.  It's just like a 
>>> normal C link.  Try:
>>>
>>> dmd hello Word.o -I~/sandbox
>>>
>>> Note that D still imports via source files (or D interface files), not via 
>>> object files.  So when you import something you are not importing the object 
>>> into the build, you are simply having the compiler re-parse the source file. 
>>> This is why it is generally more efficient (time-wise) to compile all your 
>>> source files at once, as the compiler only parses each file once.
>>>
>>> This is distinctly different from Java, which imports the compiled file.
>>>
>>> -Steve 
>>>
>> Does this mean I still have to list all my object files on the command line?
>>  That could make quite a long entry.
>> 
> 	That's why we have tools such as dsss or SCons...

And 'Bud' ( http://www.dsource.org/projects/build )

Note that the -I switch is used to specify a location for imports. Object
files are *not* imported so the -I switch has nothing to do with object
files. The full path of each object files is required on the command line,
though if that can be expressed as one relative to the current directory
you can specify it that way too. The D copmiler does not read object files
but merely passes them, as specified, to the linker.

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell



More information about the Digitalmars-d mailing list