Lazarus

Programming => General => Topic started by: Logic_Bomb on August 29, 2011, 05:59:56 am

Title: [Solved] Runtime Error 103
Post by: Logic_Bomb on August 29, 2011, 05:59:56 am
I have been using Lazarus & ObjPascal/Delphi for a while now and this is by far the most confusing problem I have had... I have been making a simple application to teach my friend (Who is new to ObjPascal) the basics, and it seems that I myself am having issues with the basics... He has compiles & run the same code as I am and it works fine for him, which raises the question, what's gone wrong? This code has worked fine for me in the past and is only a simple 'Hello World' application, running the following:

Code: [Select]
program project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes
  { you can add units after this };

{$R *.res}

begin
  Writeln('Hi');
  Readln();
end.

Throws up no debug messages but a run-time message that says the following:
Code: [Select]
"Project project1.exe raised exception class 'RunError(103)'."
The IDE then points to this line:
Code: [Select]
Writeln('Hi');
and Upon hovering over the line gives this message:
Code: [Select]
"Writeln = No Symbol \"Writeln\" in current context."
If I then try and run the .EXE I get the following Error:
Code: [Select]
"An unhandled exception occurred at $0040151B :
EInOutError : File not open
$0050151B Line 15 of project1.lpr"

I am utterly baffled. as my friend can run the code with no problems and yet my IDE will run other applications fine, but refuses to run newly created console applications...

Lazarus Info:
 - Version: 0.9.30
 - Date: 2011-03-08
 - FCP Version: 2.4.2
 - SVN Revision: 29749
 - i386-win32-win32/win64

Any help would be greatly appreciated and if any of my spelling or grammar is incorrect please exuse - it is early hours of the morning and i'm kinda frustrated with this! xD

Thanks.

Logic~
Title: Re: Runtime Error 103
Post by: Leledumbo on August 29, 2011, 06:50:24 am
Ensure you don't check -WG (GUI application) in compiler option, that would close standard output. WriteLn (by default) writes to standard output.
Title: Re: Runtime Error 103
Post by: Logic_Bomb on August 29, 2011, 06:58:23 am
Ensure you don't check -WG (GUI application) in compiler option, that would close standard output. WriteLn (by default) writes to standard output.

You sir, are a saviour! And i'm an idiot!! xD Completely missed that in the compiler options, Didn't cross my mind that it'd be as simple as that!!!

Thanks alot, Really, really appreciated!!! =)

Logic~
TinyPortal © 2005-2018