.obj files conflict

Derek Parnell derek at psych.ward
Tue Dec 26 12:48:27 PST 2006


On Tue, 26 Dec 2006 16:53:47 +0000 (UTC), Nick Atamas wrote:

> I find that .obj files conflict when I use the -od flag to redirect
> intermediate output to a directory. Shouldn't obj files get the name of their
> package? So, sdl.timer.obj instead of just timer.obj.
> 
> e.g.
> 
> c:\proj> bud -odbin src/main.d
> [proj]
>   |--[bin]
>   \--[src]
>       |--[A]
>       |  \--Timer.d
>       |
>       |--[sdl]
>       |   \--timer.d
>       |
>       \--main.d  #imports and uses both timers
> 
> 
> This will cause a linker error because bin/Timer.obj will be overwritten by
> bin/timer.obj.
> 
> This isn't just a problem on windows. If we had both lower-case names as in
> A/timer.d and sdl/timer.d, there would still be a linker error.

By the way, this is not a problem caused by using Bud. It is a function of
the way that DMD works.
 
For Bud to 'fix' this, it would either have to compile each source file
seperately, adjustng the -od switch accordingly, or copy the entire source
code structure to the root mentioned in the -od switch, compile all the
copied source with the -op switch instead of -od, then delete the source
copies.

-- 
Derek


More information about the Digitalmars-d-bugs mailing list