Trouble with modules
Derek Parnell
derek at psych.ward
Sat Apr 15 06:30:14 PDT 2006
On Sat, 15 Apr 2006 18:27:44 +1000, Andrew Madigan <amadigan at gmail.com>
wrote:
> Derek Parnell wrote:
>
>> On Sat, 15 Apr 2006 16:19:36 +1000, Andrew Madigan <amadigan at gmail.com>
>> wrote:
>>
>>> I have a file called HttpCommon.d where I am throwing code that needs
>>> to
>>> be
>>> imported by a few files in my project. It contains an enum and a few
>>> constants. When I try to to import it, I get the following error:
>>>
>>> Request.d:5: module HttpCommmon cannot read file 'HttpCommmon.d'
>>>
>>> HttpCommon.d (in the same directory) contains:
>>
>> There is a restriction in D in that one cannot have a module with the
>> same
>> name as the directory it appears in. The simple workaround is to rename
>> one or the other.
>>
>
> hmmm, maybe I am misunderstanding, but the directory these files are in
> is
> called "dhttp" (I'm on linux, so the path is really just ~/dhttp). The
> file
> structure looks like this:
>
> dhttp
> Request.d
> HttpCommon.d
> [other d files]
> Makefile
>
> Does HttpCommon need to be in a subdirectory? I admit I find all this a
> little confusing, Java handles things a little differently.
Sorry, it was my misunderstanding (I rushed a reply as I was going out to
see my football team play - they lost).
Have you tried the Build utility? It would avoid spelling mistakes like
this.
--
Derek Parnell
Melbourne, Australia
More information about the Digitalmars-d-learn
mailing list