IonicWind Software

Aurora Compiler => General Discussion => Topic started by: Zen on December 11, 2005, 03:36:45 PM

Title: Problems With Source Files
Post by: Zen on December 11, 2005, 03:36:45 PM
Hi. Im still getting those problems using Classes in one file and my main subroutine in another. Ive tried copying the class definition into my main file, putting it in a seperate file and including it in both the class and main program files and im still getting compile errors.

Lewis
Title: Re: Problems With Source Files
Post by: Parker on December 11, 2005, 03:40:03 PM
That's odd. I have 4 or 5 classes in one header file that every file includes and it works fine. Maybe you could post the errors you're getting and the class definitions and I can help.
Title: Re: Problems With Source Files
Post by: Zen on December 11, 2005, 04:18:28 PM
Ok main source file:


class myWindow : window {

declare OnCreate();
declare OnClose();

}

global sub main() {

myWindow Win;

Win.Create(0,0,640,480,AWS_CAPTION|AWS_VISIBLE|AWS_BORDER|AWS_SYSMENU|AWS_AUTODRAW,0,"Test GUI",null);

do {

wait();

} until Win.m_hwnd = 0;

return;

}


And The Class File


class myWindow : window {

declare OnCreate();
declare OnClose();

}

myWindow :: OnClose() {

Destroy();

return true;

}

myWindow :: OnCreate() {

CenterWindow();

return true;

}


And the errors...


Compiling...
Main
C:\Documents and Settings\Administrator\My Documents\Projects\GUI\Main.src:23: error: symbol `myWindow@OnClose' undefined
C:\Documents and Settings\Administrator\My Documents\Projects\GUI\Main.src:23: error: symbol `myWindow@OnCreate' undefined
Error(s) in assembling "C:\Documents and Settings\Administrator\My Documents\Projects\GUI\Main.asm"
myWindow


Any ideas?
Lewis
Title: Re: Problems With Source Files
Post by: Ionic Wind Support Team on December 11, 2005, 04:27:24 PM
Give me a minute to look into it.

Paul.
Title: Re: Problems With Source Files
Post by: Ionic Wind Support Team on December 11, 2005, 04:37:51 PM
It's a small logic bug...will fix shortly.

Instead of duplicating your class definition you shour really use an include file.  Not that that would make a difference in this case.

Paul.
Title: Re: Problems With Source Files
Post by: Parker on December 11, 2005, 04:55:13 PM
Oh, I see. My classes aren't using virtual functions. Not much I can do since it's a compiler bug :)
Title: Re: Problems With Source Files
Post by: Ionic Wind Support Team on December 11, 2005, 05:01:02 PM
Yes they are.  Just use the virtual keyword until I fix the bug.


class myWindow : window {

declare virtual OnCreate();
declare virtual OnClose();

}


The compiler was correctly marking the function as virtual, since the base class function was declared as such.  But it was neglecting to check to see if it was an external function.

C++ forces the virtual keyword on derived classes, I am attempting to avoid it ;)

Paul.
Title: Re: Problems With Source Files
Post by: Parker on December 11, 2005, 05:05:53 PM
The window ones are, but I was referring to classes that I use for stacks, dictionaries, etc.
Title: Re: Problems With Source Files
Post by: Ionic Wind Support Team on December 11, 2005, 05:07:10 PM
Sorry,
Thought lewis posted ;)

Paul.