digitalmars.D.bugs - .obj files conflict
- Nick Atamas (19/19) Dec 26 2006 I find that .obj files conflict when I use the -od flag to redirect
- Derek Parnell (11/35) Dec 26 2006 By the way, this is not a problem caused by using Bud. It is a function ...
- Sean Kelly (5/40) Dec 26 2006 I think the -od and -op flags can be used together, so the object files
- Derek Parnell (13/20) Dec 26 2006 Yes, one would think so, but it just doesn't work. Try setting the -od t...
- Nick Atamas (3/17) Dec 26 2006 I tried -od and -op together beforing posting this bug. Adding -op seeme...
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.
Dec 26 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
Dec 26 2006
Derek Parnell wrote:On Tue, 26 Dec 2006 16:53:47 +0000 (UTC), Nick Atamas wrote:I think the -od and -op flags can be used together, so the object files would all end up in subdirectories of bin. Then it's simply a matter of recursively linking all object files in that tree. SeanI 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.
Dec 26 2006
On Tue, 26 Dec 2006 14:20:22 -0800, Sean Kelly wrote: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.I think the -od and -op flags can be used together, so the object files would all end up in subdirectories of bin. Then it's simply a matter of recursively linking all object files in that tree.Yes, one would think so, but it just doesn't work. Try setting the -od to reference a different drive than the source file? dmd -op -odD:\bin c:\SOURCE\project.d Absolute chaos follows ;-) In short, -od and -op cannot be safely used together (as far as my testing shows so far). -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocrity!" 27/12/2006 10:22:13 AM
Dec 26 2006
== Quote from Derek Parnell (derek nomail.afraid.org)'s articleOn Tue, 26 Dec 2006 14:20:22 -0800, Sean Kelly wrote:I tried -od and -op together beforing posting this bug. Adding -op seemed to do nothing.Yes, one would think so, but it just doesn't work. Try setting the -od to reference a different drive than the source file? dmd -op -odD:\bin c:\SOURCE\project.d Absolute chaos follows ;-) In short, -od and -op cannot be safely used together (as far as my testing shows so far).On Tue, 26 Dec 2006 16:53:47 +0000 (UTC), Nick Atamas wrote:I think the -od and -op flags can be used together, so the object files would all end up in subdirectories of bin. Then it's simply a matter of recursively linking all object files in that tree.I find that .obj files conflict when I use the -od flag to redirect intermediate output to a directory.
Dec 26 2006