www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Compiling graphics.graphics

reply "news.digitalmars.com" <gtbass studiotekne.com> writes:
I have a module "main.d" in which I import:

    import std.c.windows.windows;
    import graphics.graphics;

and my source tree looks like this (brackets indicate directories):

    [src]
        main.d
        [graphics]
            graphics.d

When I attempt to compile main.d:

    dmd main graphics\graphics
    graphics\graphics.d: module graphics module and package
    have the same name

This error message seems unusual, since windows.d has the same name as 
package windows.  However, I tried changing the package name to:

    import std.c.windows.windows;
    import gfx.graphics;

and changed the source tree to:

    [src]
        main.d
        [gfx]
            graphics.d

When I attempt to compile:

    dmd main gfx\graphics
    main.d(9): module graphics is in multiply defined

I'm confused how this should be done.  What is the appropriate argument 
syntax to compile main.d with dmd?  Can graphics.d be in a package called 
graphics?

Thanks,
Garett 
Nov 15 2004
next sibling parent Ant <Ant_member pathlink.com> writes:
In article <cnb3tu$kg0$1 digitaldaemon.com>, news.digitalmars.com says...
    main.d(9): module graphics is in multiply defined

it might not be it but make sure you have the module definition on all source files, like: module something; that help the compiler to figure out what is the real problem. if you try it, please let us know if it was that. Ant
Nov 15 2004
prev sibling next sibling parent Regan Heath <regan netwin.co.nz> writes:
On Mon, 15 Nov 2004 14:36:36 -0600, news.digitalmars.com 
<gtbass studiotekne.com> wrote:
 I have a module "main.d" in which I import:

     import std.c.windows.windows;
     import graphics.graphics;

 and my source tree looks like this (brackets indicate directories):

     [src]
         main.d
         [graphics]
             graphics.d

 When I attempt to compile main.d:

     dmd main graphics\graphics
     graphics\graphics.d: module graphics module and package
     have the same name

 This error message seems unusual, since windows.d has the same name as
 package windows.  However, I tried changing the package name to:

     import std.c.windows.windows;
     import gfx.graphics;

 and changed the source tree to:

     [src]
         main.d
         [gfx]
             graphics.d

 When I attempt to compile:

     dmd main gfx\graphics
     main.d(9): module graphics is in multiply defined

 I'm confused how this should be done.  What is the appropriate argument
 syntax to compile main.d with dmd?  Can graphics.d be in a package called
 graphics?

I suspect graphics.d contains "module graphics.graphics;" and changing that to "module gfx.graphics;" would fix it. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 2004
prev sibling parent "news.digitalmars.com" <gtbass studiotekne.com> writes:
As per Ant's suggestion, I added the following to the top of "graphics.d":

    module graphics.graphics;

That solved my problem!

Many thanks,
Garett 
Nov 15 2004