When writing a Lazarus program, you have the option of using $APPTYPE console or deselecting the Win32 GUI Application (-WG option) in the Project Options .
I noticed that without these options DebugLn and WriteLn raise exceptions. Is there a way to create a console even if the program is not compiled above mentioned options and output to it with DebugLn and WriteLn afterwards?