digitalmars.D - modules with the same name in different packages
- Mahe (47/47) Sep 29 2007 Hi,
- Alexander Panek (5/12) Sep 29 2007 It rather seems like you're /missing/ a symbol in your object. Apart fro...
- Janice Caron (2/4) Sep 29 2007 The trick is not to build all the object files in the same directory. :-...
- Bill Baxter (4/9) Sep 29 2007 Or use dsss/rebuild which automatically gives the objs unique names
- Mahe (4/13) Sep 30 2007 Oh, thanks!
Hi, I have a problem with 2 modules with the same name in different packages. It seems that one module obj overwrites the other. Is there a possibility to solve that (except renaming the packages, because this would make packages useless) Here some example source code. I compile it with: dmd main.d -odbin And get the error OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. bin\main.obj(main) Error 42: Symbol Undefined _D4pack3mod4Mod27__ClassZ --- errorlevel 1 module pack.mod; import tango.io.Console; class Mod2 { public void foo() { Cout( "pack.mod" ).newline; } } module mod; import tango.io.Console; class Mod1 { public void foo() { Cout( "mod" ).newline; } } module main; import tango.io.Console; import mod; import pack.mod; void main() { Mod1 m1 = new Mod1; Mod2 m2 = new Mod2; m1.foo; m2.foo; Cout ("Hello" ).newline; }
Sep 29 2007
On Sat, 29 Sep 2007 15:58:17 -0400 Mahe <maheweb web.de> wrote:dmd main.d -odbin And get the error OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. bin\main.obj(main) Error 42: Symbol Undefined _D4pack3mod4Mod27__ClassZ --- errorlevel 1It rather seems like you're /missing/ a symbol in your object. Apart from that, you don't compile the other packages, so it's kind of natural that the symbols are missing. -- Alexander Panek <alexander.panek brainsware.org>
Sep 29 2007
On 9/29/07, Mahe <maheweb web.de> wrote:Hi, I have a problem with 2 modules with the same name in different packages. It seems that one module obj overwrites the other.The trick is not to build all the object files in the same directory. :-)
Sep 29 2007
Janice Caron wrote:On 9/29/07, Mahe <maheweb web.de> wrote:Or use dsss/rebuild which automatically gives the objs unique names based on their directory names. --bbHi, I have a problem with 2 modules with the same name in different packages. It seems that one module obj overwrites the other.The trick is not to build all the object files in the same directory. :-)
Sep 29 2007
Bill Baxter Wrote:Or use dsss/rebuild which automatically gives the objs unique names based on their directory names. --bbOr use dsss/rebuild which automatically gives the objs unique names based on their directory names. --bbOh, thanks! I had also tried building with rebuild. But with the parameter “-od…” it didn’t work. I now tried without it and it works! After a closer look into the help of rebuild I found the parameter “-oq…”. Now it also works with an object files directory :-)
Sep 30 2007