[fpc-pascal] Options -WG -WC -WF -WT

Sven Barth pascaldragon at googlemail.com
Sun Jan 29 18:03:56 CET 2012


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
-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



More information about the fpc-pascal mailing list