You already got the answer: IF you want to use writeln in a GUI application then you need {$apptype console} but only on Windows. Under linux, it works if your program starts from a console (e.g.: startlazarus). There are ways around it, but that should work for now. Examine the code of lazlogger too.