Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-01

ERROR in a simple console app

10 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marcos Douglas

Guys,

I tried to run an app, converted from Delphi, and I found some errors... So, I tried to run a simple app and I found errors too.

The code (copy here http://wiki.lazarus.freepascal.org/Console_Mode_Pascal):
program project1;
{$mode objfpc}{$H+}
uses
? {$IFDEF UNIX}{$IFDEF UseCThreads}
? cthreads,
? {$ENDIF}{$ENDIF}
? Classes
? { you can add units after this };
begin
? WriteLn('Hello World!');
? ReadLn;
end.

When I run inside Lazarus, happen this error:
Project project1.exe raised exception class 'RunError(103)'

When I run in line command, happen this error:
An unhandled exception occurred at $0040155B :
EInOutError : File not open
? $0040155B? main,? line 10 of project1.lpr

My config:
WinXP - FPC 2.5.1 - Laz 0.9.31 (trunk)

Marcos Douglas

Reply by email

Alex Shishkin
to Marcos Douglas

15.01.2011 15:22, Marcos Douglas ?????:

Show quoted text 32 lines
Guys, I tried to run an app, converted from Delphi, and I found some errors... So, I tried to run a simple app and I found errors too. The code (copy here http://wiki.lazarus.freepascal.org/Console_Mode_Pascal): program project1; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes { you can add units after this }; begin WriteLn('Hello World!'); ReadLn; end. When I run inside Lazarus, happen this error: Project project1.exe raised exception class 'RunError(103)' When I run in line command, happen this error: An unhandled exception occurred at $0040155B : EInOutError : File not open $0040155B main, line 10 of project1.lpr My config: WinXP - FPC 2.5.1 - Laz 0.9.31 (trunk) //lists.lazarus.freepascal.org/mailman/listinfo/lazarus

It must be compiled as console application on w32.

Reply by email

Henry Vermaak
to Marcos Douglas: I tried to run an app, converted from Delphi, and I found some errors... So, I tried to…
Marcos Douglas wrote 26 lines
Guys, I tried to run an app, converted from Delphi, and I found some errors... So, I tried to run a simple app and I found errors too. The code (copy here http://wiki.lazarus.freepascal.org/Console_Mode_Pascal): program project1; {$mode objfpc}{$H+} uses ? {$IFDEF UNIX}{$IFDEF UseCThreads} ? cthreads, ? {$ENDIF}{$ENDIF} ? Classes ? { you can add units after this }; begin ? WriteLn('Hello World!'); ? ReadLn; end. When I run inside Lazarus, happen this error: Project project1.exe raised exception class 'RunError(103)' When I run in line command, happen this error: An unhandled exception occurred at $0040155B : EInOutError : File not open ? $0040155B? main,? line 10 of project1.lpr

Did you actually create a new console application in lazarus? Make sure that the Project Options -> Linking -> Win32 gui application is not ticked.

Henry

Reply by email

Marcos Douglas
to Henry Vermaak
Henry Vermaak wrote 31 lines
On 15 January 2011 12:22, Marcos Douglas wrote: > Guys, > > I tried to run an app, converted from Delphi, and I found some errors... > So, I tried to run a simple app and I found errors too. > > The code (copy here http://wiki.lazarus.freepascal.org/Console_Mode_Pascal): > program project1; > {$mode objfpc}{$H+} > uses > ? {$IFDEF UNIX}{$IFDEF UseCThreads} > ? cthreads, > ? {$ENDIF}{$ENDIF} > ? Classes > ? { you can add units after this }; > begin > ? WriteLn('Hello World!'); > ? ReadLn; > end. > > When I run inside Lazarus, happen this error: > Project project1.exe raised exception class 'RunError(103)' > > When I run in line command, happen this error: > An unhandled exception occurred at $0040155B : > EInOutError : File not open > ? $0040155B? main,? line 10 of project1.lpr Did you actually create a new console application in lazarus? ?Make sure that the Project Options -> Linking -> Win32 gui application is not ticked.

You got it.
But I think this is a bug... I chose File->New->Program i.e. "Console App".

Thanks
Marcos Douglas

Reply by email

Mattias Gaertner
to Marcos Douglas
Show quoted text 35 lines
On Sat, Jan 15, 2011 at 10:27 AM, Henry Vermaak wrote: > On 15 January 2011 12:22, Marcos Douglas wrote: >> Guys, >> >> I tried to run an app, converted from Delphi, and I found some errors... >> So, I tried to run a simple app and I found errors too. >> >> The code (copy here http://wiki.lazarus.freepascal.org/Console_Mode_Pascal): >> program project1; >> {$mode objfpc}{$H+} >> uses >> ? {$IFDEF UNIX}{$IFDEF UseCThreads} >> ? cthreads, >> ? {$ENDIF}{$ENDIF} >> ? Classes >> ? { you can add units after this }; >> begin >> ? WriteLn('Hello World!'); >> ? ReadLn; >> end. >> >> When I run inside Lazarus, happen this error: >> Project project1.exe raised exception class 'RunError(103)' >> >> When I run in line command, happen this error: >> An unhandled exception occurred at $0040155B : >> EInOutError : File not open >> ? $0040155B? main,? line 10 of project1.lpr > > Did you actually create a new console application in lazarus? ?Make > sure that the Project Options -> Linking -> Win32 gui application is > not ticked. You got it. But I think this is a bug... I chose File->New->Program i.e. "Console App".

Fixed in svn.

Mattias

Reply by email

Marcos Douglas
to Mattias Gaertner
Mattias Gaertner wrote 6 lines
On Sat, 15 Jan 2011 10:42:23 -0200 Marcos Douglas wrote: > You got it. > But I think this is a bug... I chose File->New->Program ?i.e. "Console App". Fixed in svn.

Thank you.

Marcos Douglas

PS: you has been correcting the bug faster than me writing a post bug =)

Reply by email

Marcos Douglas
to Paul Ishenin
Paul Ishenin wrote 17 lines
15.01.2011 19:22, Marcos Douglas wrote: > > program project1; > {$mode objfpc}{$H+} add {$apptype console} here > > uses > ? {$IFDEF UNIX}{$IFDEF UseCThreads} > ? cthreads, > ? {$ENDIF}{$ENDIF} > ? Classes > ? { you can add units after this }; > begin > ? WriteLn('Hello World!'); > ? ReadLn; > end.

Yes, like Delphi.
But the wizards do not pose this condition. Why? There are some advantages?

Marcos Douglas

Reply by email