Here we go, simply add gSystem->RedirectOutput("CONOUT$", "w");
as shown below:
// Generate a console to display the output
AllocConsole();
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
gSystem->RedirectOutput("CONOUT$", "w");
sorry for the delay…