Author Topic: solved the redirect problem when debugging a GUI wxWidgets app  (Read 3088 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Several months ago, I have asked a question on this forum " how do I  trace the debug information to a console window", or "can I redirect the console output to GDB console or somewhere else? ".

See:
http://forums.codeblocks.org/index.php/topic,10057.0.html

Today, I found one solution( at least on Windows)

Here is the steps:

1,Assume your project was generated by a wxWidgets wizard.

2,Go to the Menu->project->properties dialog.

3, select the build target tab

4, Change the Target type from "Gui applications" to "console applications".

5, Check on the "Pause when execution ends"

6, rebuild your program.

7, Run your apps, Now,all the "printf and related console output" can be viewed from a console window behind your wxWigets GUIs.

Thanks.
I welcome any suggestions. :D



If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.