Re: Error in opening the Library module file
- From: "Jugoslav Dujic" <jdujic@xxxxxxxxx>
- Date: Thu, 28 Sep 2006 10:14:56 +0200
Mike wrote:
| Mike wrote:
|| Jugoslav Dujic wrote:
||| Mike wrote:
|||| Mike wrote:
||||| Originally they pick up some modules, however, they didn't pick up
||||| modules which
||||| are calling each other. I think this problem is called cyclic
||||| dependencies, right?
|||
||| Right, "cyclic" or "circular". What you had is (as far as I can tell)
||| allowed by the standard but it will confuse most compilers -- they
||| expect the dependency hierarchy to be "tree-like" and cannot tell which
||| module should be compiled first (esp. when they're in the same source
||| file).
|||
||| By all means, try to avoid the situation -- the solution is often
||| to move the mutually shared stuff to a third module, which is
||| compilable separately.
|| How to avoid cyclic dependency at first?
|| What's the general idea to avoid it?
||
|| Mike
| Jugoslav has said that"
| to move the mutually shared stuff to a third module, which is
| compilable separately".
| But I mean this is the solution when problem happened.
| So, how to avoid cyclic dependency before making mistake?
| Yes. The solution is also what Jugoslav said.
| But when I write a new subroutine/function with some many USEd
| modules, do I really need to
| see the dependencies ? It's quite troublesome.
"Weeks of coding can save you hours of planning".
While the maxim is ironical indeed, the point is that you have to
think about the problem in advance and DESIGN the software before
you start throwing code at it. That means creating a general
overview of "blocks" (modules/source files), each dedicated to doing
one particular thing, then drawing dependencies between them, creating
a dependency tree and anticipate the problems in advance (so that you
don't end up in the situation like the one you describe). Only then,
you can start coding -- some prefer "top-to-bottom" (rough outline
of the algorithm first, then gory details in "low-level" modules),
others "bottom-to-top", (like assembling Lego puzzles).
But sorry, I can't give you an intelligent answer as to how to
solve that particular problem -- I simply don't have enough data.
We don't know what is the exact problem that is supposed to be
solved. Can you briefly state the kind of problem you're trying to
solve and/or post some actual code?
--
Jugoslav
___________
www.xeffort.com
Please reply to the newsgroup.
You can find my real e-mail on my home page above.
.
- References:
- Error in opening the Library module file
- From: Mike
- Re: Error in opening the Library module file
- From: Mike
- Re: Error in opening the Library module file
- From: dpb
- Re: Error in opening the Library module file
- From: Mike
- Re: Error in opening the Library module file
- From: Mike
- Re: Error in opening the Library module file
- From: Mike
- Re: Error in opening the Library module file
- From: Jugoslav Dujic
- Re: Error in opening the Library module file
- From: Mike
- Re: Error in opening the Library module file
- From: Mike
- Error in opening the Library module file
- Prev by Date: Re: compile only one module file
- Next by Date: Re: Apology to comp.lang.fortran
- Previous by thread: Re: Error in opening the Library module file
- Next by thread: Question on multiple compiler environment
- Index(es):