Trouble with modules

John C johnch_atms at hotmail.com
Sat Apr 15 01:58:34 PDT 2006


Andrew Madigan 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'

You get this message if you haven't passed a file to the compiler.

dmd HttpCommon.d

> 
> HttpCommon.d (in the same directory) contains:
> 
> //Common globals for HTTP
> 
> enum Protocol   {
>         //Removed
> }
> 
> static char[] getProtocolName(Protocol protocol)        {
>         //Removed
> }
> 
> static Protocol getProtocolByName(char[] name)  {
>         //Removed
> }
> 
> class StatusCode        {
>         //Removed
> }
> 
> What's going on? I don't understand how the compiler finds files, but I'm
> thinking that's where it's going wrong.



More information about the Digitalmars-d-learn mailing list