"module is in multiple packages" error

Johan Granberg lijat.meREM at OVE.gmail.com
Wed Jan 3 16:17:33 PST 2007


Jona Joachim wrote:

> Hi!
> I have to bother you with a beginner problem...
> I want to develop a spring model engine where you have pointmasses
> attached to spring which oscillate and stuff.
> I created a module called "connectors" which contains all sorts of
> connectors like springs, dampers, ... and a module called "point" which
> contains pointmasses and hooks.
> Now a connector should know what pointmasses are attached to it and a
> pointmass should know to which connectors it is attached...
> That's why point.d does a "private import connector" and connector.d does
> a "private import point". This works very well in C with header files and
> #ifdefs. However gdc throws following error:
> 
> gdc -I/home/jona/prog/d/derelict -O2 -fno-strict-aliasing -c point.d
> connector.d:5: module constructor.point is in multiple packages
> constructor.point gmake: *** [point.o] Error 1
> 
> Could anybody tell me how I should manage this kind of situation?
> 
> Thanks a lot,
> Jona

Try declaring the modules explicityl.

in point.d you write:
module point;//or directoryname.subdirectoryname.point

and in constructor you write:
module constructor;

if this doesent work how does you directory structur looks like (is point
and constructor in the same directory?)


More information about the Digitalmars-d-learn mailing list