Jump to content
Patrick vd P.

PAServer Linux (WSL2) Delphi 12.2 does not output to console

Recommended Posts

Hi,

I'm testing some console code to run under Ubunu 22.04 (WSL2), but a very simple application only using WriteLn('Hello World!!'); doesn't seem to work when using the PAServer. There is no output on the Linux console.
When I start the project directly from the scratch-dir it does work as desired, e.g. outputting "Hello World!!".
I've done the following:
In the WSL console I have installed the dev packages:

sudo apt install libcurl4-gnutls-dev build-essential

The copied/unpacked the PAServer V23.0 as per DocWiki. I have connected to the PAServer from Delphi and loaded the SDK. I do not see any errors.

The application I use is very simple:

program Test;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

begin
  try
   Writeln('Hello World!!');
   ReadLn;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.

Any suggestions on what I'm doing wrong?

Share this post


Link to post

Not sure I understand your question. Do you expect the output in the console in which you ran the PAServer? If so, that's not going to happen, because PAServer only acts as an intermediary for building and debugging the app on that platform, not outputting app logs (except for exceptions, at least to my knowledge). However, Writeln will output to the IDE Messages panel if running with a debugger, and that was always enough for me.

Edited by havrlisan

Share this post


Link to post

Okay, I thought I have seen (probably very old) videos of output in the console (indeed the one running PAServer).


But if that is not going to work, how will I be able to debug console applications which require input from the user?

Share this post


Link to post
22 minutes ago, Patrick vd P. said:

Okay, I thought I have seen (probably very old) videos of output in the console (indeed the one running PAServer).


But if that is not going to work, how will I be able to debug console applications which require input from the user?

That's a good question, I didn't have that case yet so haven't thought about it. Perhaps install the desktop environment and see if the app console will display itself? I never tested Console apps on other platforms, so can't help much in that area. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×