When trying to debug a program on Windows I can't seem to find where the output I push to stderr is going. How do I get a hold of my stderr output? Is there a debugger-level setting (MSVC 9) I can change to redirect stderr to some part of the UI?
Update: I have not looked into TRACE
or OutputDebugString
, but the code base is cross-platform, so platform-specific APIs, while not totally off the table, are secondary to a standards-compliant solution.
By default, stderr is typically connected to the same place as stdout, i.e. the current terminal.
The fprintf(stderr, “”) is the statement is used by both stdout and stderr to print the output message or error message within the double quotes to the window terminal or console.
In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).
Another approach, using files:
http://msdn.microsoft.com/en-us/library/aa236457(VS.60).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With