Trouble with modules

Andrew Madigan amadigan at gmail.com
Sat Apr 15 02:20:42 PDT 2006


John C wrote:

> 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.

andymadigan at andym:~/dhttp$ gdc -c Request.d HttpCommon.d
Request.d:5: module HttpCommmon cannot read file 'HttpCommmon.d'

Note that HttpCommon.d does build fine.



More information about the Digitalmars-d-learn mailing list