Solutions to the TypeInfo dependency injection issue?

Derek Parnell derek at psych.ward
Thu Mar 8 13:44:31 PST 2007


On Thu, 08 Mar 2007 12:36:24 -0800, Walter Bright wrote:

>> Walter Bright wrote:
>> 
>>> This situation also only crops up when you're passing all the modules 
>>> at once to dmd, and then putting the resulting object files into a 
>>> library. Try compiling the modules independently when they are 
>>> intended to be put in a library.
 
> When you compile:
> 	dmd -c a b
> then dmd is assuming that a.obj and b.obj will be linked together, so it 
> does not matter which object file something is placed in. In other 
> words, it does not generate things twice.
> 
> On the other hand:
> 	dmd -c a
> 	dmd -c b
> then dmd doesn't know, when compiling a.obj what will be in b.obj, so it 
> assumes the worst and generates it.
> 
> In other words:
> 	dmd -c a b
> 	lib foo.lib a.obj b.obj
> is not a good way to create a library, instead:
> 	dmd -c a
> 	dmd -c b
> 	lib foo.lib a.obj b.obj

One of the things that greatly impressed me was DMD's ability to quickly
compile multiple files in one pass, rather than the make-like process on
doing one file per DMD run. So when I came to write Bud, I made a lot of
effort to ensure that I could compile as many as possible files in one call
to the compiler. 

It now seems that you are warning us against this feature of DMD, in the
case of creating libraries. This is extremely disappointing.

I will add a new switch to Bud to force file-by-file compilation.

-- 
Derek Parnell
Melbourne, Australia
"Justice for David Hicks!"
skype: derek.j.parnell



More information about the Digitalmars-d mailing list