Sign in Join

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

Mailing lists / fpc-pascal / 2012-01

Options -WG -WC -WF -WT

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Mattias Gaertner

Hi,

According to fpc -h (2.7.1):

Option -WG creates graphic type application (EMX, OS/2, Windows). Option -WC creates console type application (EMX, OS/2, Windows).

fpc -h (2.6.1) knows also:
Option -WF creates full screen type application (EMX, OS/2)

And the "user" documentation knows one more:
http://www.freepascal.org/docs-html/user/usersu15.html#x38-450005.1.4

-WT Generate a TOOL application (+) or a console application (-).

Are these correct or maybe outdated?

Are they mutually exclusive or can some be paired?

What kind of program is created under Windows without any of these options?

Mattias

Reply by email

Sven Barth
to Mattias Gaertner
Mattias Gaertner wrote 16 lines
Hi, According to fpc -h (2.7.1): Option -WG creates graphic type application (EMX, OS/2, Windows). Option -WC creates console type application (EMX, OS/2, Windows). fpc -h (2.6.1) knows also: Option -WF creates full screen type application (EMX, OS/2) And the "user" documentation knows one more: http://www.freepascal.org/docs-html/user/usersu15.html#x38-450005.1.4 -WT Generate a TOOL application (+) or a console application (-). Are these correct or maybe outdated?

Here is the complete list of supported apptypes:

-WA = {$apptype native}: currently only used for NativeNT target if a driver is compiled (not finalized yet, so I wouldn't build on that ;) ) -WC = {$apptype console}: Console application on EMX, OS/2 and Windows (and according to compiler source also classic Mac OS). On Windows this means that calling that application from inside e.g. cmd.exe will block cmd.exe until the application is finished. Calling the application using the explorer will result in a console window appearing. -WG = {$apptype gui}: GUI application on EMX, OS/2 and Windows (and according to compiler source also classic Mac OS). On Windows this means that e.g. cmd.exe won't block when such an application is started and on console window will be shown. Also the Std I/O is closed by the application -WF = {$apptype fs}: Fullscreen application on EMX and OS/2 -WT = {$apptype tool}: only classic Mac OS
{$apptype arm7}, {$apptype arm9}: Only used for Nintendo DS, no command line switch available

Are they mutually exclusive or can some be paired?

They are mutually exclusive. If there are multiple on the command line then the last one will win. Also an {$apptype ...} directive in the project file will win.

What kind of program is created under Windows without any of these options?

The apptype always (not only Windows) defaults to "Console" except on WinCE where the default is "GUI".

Note (as I've also read your other mail): I would not suggest to let the IDE automatically set this based on some obscure logic. The option in "Project Settings => Compiler Settings => Linking => Target specific options" is enough.

Regards,
Sven

Reply by email

Mattias Gaertner
to Sven Barth
Show quoted text 32 lines
On 29.01.2012 17:04, Mattias Gaertner wrote: > Hi, > > According to fpc -h (2.7.1): > > Option -WG creates graphic type application (EMX, OS/2, Windows). > Option -WC creates console type application (EMX, OS/2, Windows). > > fpc -h (2.6.1) knows also: > Option -WF creates full screen type application (EMX, OS/2) > > And the "user" documentation knows one more: > http://www.freepascal.org/docs-html/user/usersu15.html#x38-450005.1.4 > > -WT Generate a TOOL application (+) or a console application (-). > > Are these correct or maybe outdated? Here is the complete list of supported apptypes: -WA = {$apptype native}: currently only used for NativeNT target if a driver is compiled (not finalized yet, so I wouldn't build on that ;) ) -WC = {$apptype console}: Console application on EMX, OS/2 and Windows (and according to compiler source also classic Mac OS). On Windows this means that calling that application from inside e.g. cmd.exe will block cmd.exe until the application is finished. Calling the application using the explorer will result in a console window appearing. -WG = {$apptype gui}: GUI application on EMX, OS/2 and Windows (and according to compiler source also classic Mac OS). On Windows this means that e.g. cmd.exe won't block when such an application is started and on console window will be shown. Also the Std I/O is closed by the application -WF = {$apptype fs}: Fullscreen application on EMX and OS/2

For 2.7.1 too?
The option is missing in the ppcx64 -h help.

Show quoted text 8 lines
-WT = {$apptype tool}: only classic Mac OS {$apptype arm7}, {$apptype arm9}: Only used for Nintendo DS, no command line switch available > Are they mutually exclusive or can some be paired? They are mutually exclusive. If there are multiple on the command line then the last one will win. Also an {$apptype ...} directive in the project file will win.

Thanks.

Show quoted text 10 lines
> What kind of program is created under Windows without any of > these options? The apptype always (not only Windows) defaults to "Console" except on WinCE where the default is "GUI". Note (as I've also read your other mail): I would not suggest to let the IDE automatically set this based on some obscure logic. The option in "Project Settings => Compiler Settings => Linking => Target specific options" is enough.

The "obscure logic" prevents that -WG is passed to the compiler for invalid targets. Otherwise the compiler stops with an error.

If I understand correct, then a Windows application without -WG is compiled as a console application and a writeln/readln should work. Right?

Mattias

Reply by email

Sven Barth
to Mattias Gaertner
Mattias Gaertner wrote 38 lines
On Sun, 29 Jan 2012 18:03:56 +0100 Sven Barth wrote: > On 29.01.2012 17:04, Mattias Gaertner wrote: >> Hi, >> >> According to fpc -h (2.7.1): >> >> Option -WG creates graphic type application (EMX, OS/2, Windows). >> Option -WC creates console type application (EMX, OS/2, Windows). >> >> fpc -h (2.6.1) knows also: >> Option -WF creates full screen type application (EMX, OS/2) >> >> And the "user" documentation knows one more: >> http://www.freepascal.org/docs-html/user/usersu15.html#x38-450005.1.4 >> >> -WT Generate a TOOL application (+) or a console application (-). >> >> Are these correct or maybe outdated? > > Here is the complete list of supported apptypes: > > -WA = {$apptype native}: currently only used for NativeNT target if a > driver is compiled (not finalized yet, so I wouldn't build on that ;) ) > -WC = {$apptype console}: Console application on EMX, OS/2 and Windows > (and according to compiler source also classic Mac OS). On Windows this > means that calling that application from inside e.g. cmd.exe will block > cmd.exe until the application is finished. Calling the application using > the explorer will result in a console window appearing. > -WG = {$apptype gui}: GUI application on EMX, OS/2 and Windows (and > according to compiler source also classic Mac OS). > On Windows this means that e.g. cmd.exe won't block when such an application is started and on > console window will be shown. Also the Std I/O is closed by the application > -WF = {$apptype fs}: Fullscreen application on EMX and OS/2 For 2.7.1 too? The option is missing in the ppcx64 -h help.

I took this knowledge from the compiler's source directly, so yes.

Show quoted text 13 lines
>> What kind of program is created under Windows without any of >> these options? > > The apptype always (not only Windows) defaults to "Console" except on > WinCE where the default is "GUI". > > Note (as I've also read your other mail): I would not suggest to let the > IDE automatically set this based on some obscure logic. The option in > "Project Settings => Compiler Settings => Linking => Target specific > options" is enough. The "obscure logic" prevents that -WG is passed to the compiler for invalid targets. Otherwise the compiler stops with an error.

I'm not talking about that specific "obscure logic". I just wanted to avoid that you add "more strange obscure logic" ;P

If I understand correct, then a Windows application without -WG is compiled as a console application and a writeln/readln should work. Right?

This is correct. At least on Win32 and Win64.

Regards,
Sven

Reply by email

Mattias Gaertner
to Sven Barth
Show quoted text 14 lines
[...] >> -WF = {$apptype fs}: Fullscreen application on EMX and OS/2 > > For 2.7.1 too? > The option is missing in the ppcx64 -h help. I took this knowledge from the compiler's source directly, so yes. [...] > The "obscure logic" prevents that -WG is passed to the compiler for > invalid targets. Otherwise the compiler stops with an error. I'm not talking about that specific "obscure logic". I just wanted to avoid that you add "more strange obscure logic" ;P

The whole point of asking here is to avoid adding anything obscure. And the "more strange obscure logic" implies that there is already some obscure logic.
Where is that?

IMO the compiler help text is obscure since it does not even mention the -WF option. Should I create a bug report?

Show quoted text 5 lines
> If I understand correct, then a Windows application without -WG is > compiled as a console application and a writeln/readln should work. > Right? This is correct. At least on Win32 and Win64.

Mattias

Reply by email

Tomas Hajny
to Mattias Gaertner
Mattias Gaertner wrote 25 lines
On Sun, 29 Jan 2012 20:13:36 +0100 Sven Barth wrote: >[...] > >> -WF = {$apptype fs}: Fullscreen application on EMX and OS/2 > > > > For 2.7.1 too? > > The option is missing in the ppcx64 -h help. > > I took this knowledge from the compiler's source directly, so yes. > >[...] > > The "obscure logic" prevents that -WG is passed to the compiler for > > invalid targets. Otherwise the compiler stops with an error. > > I'm not talking about that specific "obscure logic". I just wanted to > avoid that you add "more strange obscure logic" ;P The whole point of asking here is to avoid adding anything obscure. And the "more strange obscure logic" implies that there is already some obscure logic. Where is that? IMO the compiler help text is obscure since it does not even mention the -WF option. Should I create a bug report?

See compiler/msg/errore.msg. The strange characters at the beginning specify for which platforms and host operating systems the option is displayed ("3" = 386 like in ppc386 ;-) ). OS/2 (and EMX) can only run on x86 (or x86-64 in x86 mode, of course), i.e. that option is not valid for an x86-64 compiler.

Tomas

Reply by email