You should do that in the lpr file - on the top - or in the Lazarus IDE indeed.
When you encounter a console application example by me and others that often reads like this:
{$ifdef mswindows}{$define apptype console}{$endif}
This is only necessary for the Windows platform.
What happens is that it links in support to read and write to/from the console, so error 103 will not be triggered.
OTOH you can also define
{$apptype gui} which means that the console support code is skipped.
On many supported OS's this is not an issue, but for windows it is.