Chaosforge Forum

Coding => FPC Valkyrie => Topic started by: null1024 on January 30, 2008, 16:52

Title: Compile error in vmsg.pas
Post by: null1024 on January 30, 2008, 16:52
Well, I was trying to compile the test.pas tutorial, and I get this error:
Quote
vmsg.pas(30,8) Error: Identifier not found "class"
vmsg.pas(30,8) Error: Error in type definition
vmsg.pas(30,8) Fatal: Syntax error, ";" expected but "identifier PUBLIC" found
vmsg.pas(0) Fatal: Compilation aborted

I was using valkyrie 0.4.2
Title: Re: Compile error in vmsg.pas
Post by: Kornel Kisielewicz on January 30, 2008, 17:11
Oh my, the 0.4.2 is VERY outdated. Time to redesign the site and make some official release -_-.

As for your problem, passing -S2 or adding {$mode objfpc} to the program should help.
Title: Re: Compile error in vmsg.pas
Post by: null1024 on January 30, 2008, 17:38
Hmm... this is interesting...
Quote
vmsg.pas(30,8) Error: Identifier not found "class"
vmsg.pas(30,8) Error: Error in type definition
vmsg.pas(30,8) Fatal: Syntax error, ";" expected but "identifier PUBLIC" found
vmsg.pas(0) Fatal: Compilation aborted

Compiler switches are:
 -Op3 -Sc

And the code is:
Code: [Select]
{$mode objfpc}
program test;

uses vsystems,  // Systems unit

     voutput,   // Output interface unit

     vtoutput,  // Output TextMode implementation

     vinput,    // Input interface unit

     vtinput;   // Input TextMode implementation

begin

  Systems.Add(Output,TTextModeOutput.Init);            // Register the Output system

  Systems.Add(Input,TTextModeInput.Init);              // Register the Input system

  Output.CenterDrawString(40,12,Green,'@RH@Ge@Bl@Rl@Go@B World!'); // Draw hello world

  Output.Update;                                       // Blit it to the screen

  Input.GetKey([VKEY_ENTER,VKEY_ESCAPE]);              // Wait for ESC or Enter

end.                                                   // Disposal of objects automatic

Title: Re: Compile error in vmsg.pas
Post by: Kornel Kisielewicz on January 31, 2008, 04:02
Try -S2 compiler switch
Title: Re: Compile error in vmsg.pas
Post by: null1024 on January 31, 2008, 14:11
Ok, added it (whoops), but now this:
Quote
vstream.pas(148,18) Error: function header doesn't match the forward declaration "IOutputStream.Write(const LongInt, Pointer)"
vstream.pas(328,1) Fatal: There were 1 errors compiling module, stopping
vstream.pas(0) Fatal: Compilation aborted

-_-;;;