[Lazarus] How do you debug a console program in Linux GUI mode?

Bernd prof7bit at googlemail.com
Sat Oct 15 12:41:19 CEST 2011


In the project options uncheck the "win32 GUI application". Then it
will be run inside a terminal on linux when started from the IDE. This
will not interfere with debugging. But it will also make the compiled
program always have a black DOS box in windows, even when run outside
the IDE. (The difference in the binary affects only the windows
binary, on all other platforms this option only affects how it is
started when run from within the IDE).

Maybe this option should be inverted and renamed to: "program needs
console window". This will also affect whether on windows an attempt
to writeln() will crash your application due to missing stdout.

The IDE is using TProcess to start the application and the type of
terminal (xterm or other) that comes up is not configurable in the
IDE, it is TProcess (with the show console flag) automatically trying
to decide what is the default terminal app on your system.




More information about the Lazarus mailing list