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.Any problem? Am I missing something?

Mailing lists / lazarus / 2012-01
17 messages · 7 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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.Any problem? Am I missing something?
Are you on Windows? Then you must add "{$apptype console}".
Regards,
Sven
Only on Windows?
Ant?nio
2012/1/29 Sven Barth :
Windows and perhaps OS/2 are the only systems that differentiate between GUI and console applications.
Regards,
Sven
Maybe something could be done to make things easier for Windows users?
Ant?nio
2012/1/29 Sven Barth :
Ant?nio wroteMaybe something could be done to make things easier for Windows users?
Sure, they can move to Linux :)
But you can fill in a bug report and request to add the the templates and IFDEF for windows that add console mode, or something like that
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120129/ffcdf8cc/attachment-0001.html>
Maybe something could be done to make things easier for Windows users? Ant?nio 2012/1/29…
Maybe a "simple console application" project could be added to Lazarus or "{$apptype console}" could be added by default to "custom program" projects.
It will not be changed however, that console I/O is possible without {$apptype console}, because it was only rather recently changed to be this way (because this is how users expect Windows applications to behave).
Regards,
Sven
Sure, they can move to Linux :) But you can fill in a bug report and request to add the…
But you can fill in a bug report and request to add the the templates and IFDEF for windows that add console mode, or something like that
I think this is a good idea.
{$IFDEF Windows}{$apptype console}{$ENDIF}Ant?nio
These things can be done by the IDE by passing the right -W option. I'm not sure about the details. Some of the -W options have changed. I will ask on the FPC list, when -WG, -WC, -WF, -WT should be passed.
Mattias
program project1; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads}…
Please check Project options / Compiler options / Linking / Target OS specif options.
Make sure the -WG is not checked.
Mattias
You are right, unchecking -WG it is OK.
Ant?nio
2012/1/29 Mattias Gaertner :
Mattias:
Could you tell us where we find this in the documentation? I'm sure it's there -- I'd just like to add it to my notes since I'll probably encounter the same problem at some point :-)
Thanks,
Curt Carpenter
You will get this only if you start with an Application and then
decide to do some console stuff.It's explained in the Lazarus book. The -WG option is explained in the Free Pascal book, the FPC "User's guide", the FAQ and various other places.
I added a hint to the FAQ and the tutorial.
Mattias
I think this is a good idea. {$IFDEF Windows}{$apptype console}{$ENDIF} Ant?nio
manually or automatic? i don't know that i can remember to do this for all the apps that i'm headed towards that i develop and test on winwhatever with the ultimate goal of simply compiling on OS/2 and placing in production... this should not have to be anything manually handled... IMHO of course...
On Sun, 29 Jan 2012 13:12:38 -0600 You will get this only if you start with an…
is there now an english translation version available? i know it was discussed some time back but i've not seen anything about its availability since then :?
manually or automatic? i don't know that i can remember to do this for all the apps that…
It was an user error.
You don't need to add the directives.
Mattias
is there now an english translation version available? i know it was discussed some time…
waldo kitty wroteis there now an english translation version available? i know it was discussed some time back but i've not seen anything about its availability since then :?
Yes, the english version is available since aprox. April, last year. In the Lazarus website: http://www.lazarus.freepascal.org/ In the left side there is: "Bookstore Lazarus, the complete guide"
Which is a link to:
http://www.blaisepascal.eu/index.php?actie=./subscribers/lazarusbookinfoEnglish