dmd: Module X conflicts with itself (Was: Re: RDMD on Windows)

Rory Mcguire rjmcguire at gm_no_ail.com
Sun Aug 22 02:21:45 PDT 2010


Andrej Mitrovic wrote:

> Doh! I swear I've read somewhere that a module declaration needs to have
> the same name as the *file name*. I didn't know I had to add the path as
> well. That makes the modules work now.
> 
> In fact, I probably just read this one line in the docs:
> 
> "The ModuleDeclaration sets the name of the module and what package it
> belongs to. *If absent, the module name is taken to be the same name
> (stripped of path and extension) of the source file name.*"
> 
> But I didn't pay attention to the package stuff.
> 
> Thanks Nick for the help, I was going slightly mad there for a second. :p
> 
> 
> Nick Sabalausky Wrote:
> 
>> snip

In Java yes. I D you can use the module declaration to "move" a module.
e.g.
filename: socket.d;
module: alt.socket;

to import you'd do "import alt.socket;" even if the file is in the same
directory as the module using the file.


More information about the Digitalmars-d-learn mailing list