www.digitalmars.com         C & C++   DMDScript  

D - forward references?

reply "Lars Ivar Igesund" <larsivi stud.ntnu.no> writes:
Hi!

I'm trying to compile DUI, but for some reason a
forward reference error pops up.

Using 0.72 or 0.73 I get this:

dmd -Isrc/   -ofsrc/dui/ImageMenuItem.obj -c src/dui/ImageMenuItem.d

src\dui\CheckMenuItem.d: class CheckMenuItem forward reference of
base class MenuItem

What does this message really mean?
Why do this come up when compiling ImageMenuItem? CheckMenuItem
compiled without problems.
And since this is the last DUI-release, I guess that this must have compiled
elsewhere.

Lars Ivar Igesund
Sep 20 2003
next sibling parent Ant <Ant_member pathlink.com> writes:
In article <bkhn85$1o4m$1 digitaldaemon.com>, Lars Ivar Igesund says...
Hi!

I'm trying to compile DUI, but for some reason a
forward reference error pops up.
That's a nightmare! I lost hours and end up redesigning some relations decause of forward references! :(
Using 0.72 or 0.73 I get this:
DUI shouldn't compile with .73 because of the new & for functions. what DUI build number do you have?
dmd -Isrc/   -ofsrc/dui/ImageMenuItem.obj -c src/dui/ImageMenuItem.d

src\dui\CheckMenuItem.d: class CheckMenuItem forward reference of
base class MenuItem

What does this message really mean?
I wich I new... try to go the Makefile and move the line $(SRCDIR)dui/MenuItem \ to a position before the line $(SRCDIR)dui/CheckMenuItem \ this will probably result in that forawrd reference being replaced by a different forward reference... :(
Why do this come up when compiling ImageMenuItem? CheckMenuItem
compiled without problems.
And since this is the last DUI-release, I guess that this must have compiled
elsewhere.
so I guess you have Version 00.04 build 61 (2003/09/09) I'll make a new release for dmd 0.73, make sure there are no problems compiling it, and make an announcement here. (need a few of hours though, can't work on it right now. grab a chair... ) However we still need help in understanding the forward reference problem, why? and what to do to fix it? Ant
Sep 20 2003
prev sibling parent reply Ant <Ant_member pathlink.com> writes:
In article <bkhn85$1o4m$1 digitaldaemon.com>, Lars Ivar Igesund says...
Hi!

I'm trying to compile DUI, but for some reason a
forward reference error pops up.

Using 0.72 or 0.73 I get this:

dmd -Isrc/   -ofsrc/dui/ImageMenuItem.obj -c src/dui/ImageMenuItem.d

src\dui\CheckMenuItem.d: class CheckMenuItem forward reference of
base class MenuItem

What does this message really mean?
Why do this come up when compiling ImageMenuItem? CheckMenuItem
compiled without problems.
And since this is the last DUI-release, I guess that this must have compiled
elsewhere.

Lars Ivar Igesund
I dropped the current development into the night build page It supports DMD 0.73 and doesn't have a problem with forward references (but neither had the other version) Ant
Sep 20 2003
parent reply "Lars Ivar Igesund" <larsivi stud.ntnu.no> writes:
"Ant" <Ant_member pathlink.com> wrote in message

 I dropped the current development into the night build page
 It supports DMD 0.73 and doesn't have a problem with
 forward references (but neither had the other version)
I guess I forgot to mention that I'm trying on windows. My point wasn't really that it was a problem with DUI (since I'm experimenting with the build system used; I'm no fan of make), but that I still don't grok the error message. I know what a forward reference is, but I don't understand why it comes up here. (The error message is bad, btw. It don't even say that it is an error and no hint to how the problem can be fixed.) If i clear out all compiled objectfiles, removes CheckMenuItem.d (CMI) and compile MenuItem.d (MI) only, I get a read error because CMI isn't there. But MI don't use CMI, it's CMI that use MI. There might be some strange circular reference somewhere, but that should not be a problem since all imported modules with the private attribute. Maybe private import foo; is buggy? Lars Ivar Igesund
Sep 22 2003
parent "Walter" <walter digitalmars.com> writes:
"Lars Ivar Igesund" <larsivi stud.ntnu.no> wrote in message
news:bkmeds$bf2$1 digitaldaemon.com...
 I know what a forward reference is, but I don't understand
 why it comes up here. (The error message is bad, btw. It don't
 even say that it is an error and no hint to how the problem can
 be fixed.)
It's usually when two classes mutually refer to each other, requiring more info than just the name of the class.
Dec 08 2003