Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When debugging on Windows where does stderr go?

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.

like image 487
fbrereto Avatar asked Aug 27 '09 19:08

fbrereto


People also ask

Where is stderr stored?

By default, stderr is typically connected to the same place as stdout, i.e. the current terminal.

Where does fprintf stderr go?

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.

How do I set debug configuration in Visual Studio?

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).


1 Answers

Another approach, using files:

http://msdn.microsoft.com/en-us/library/aa236457(VS.60).aspx

like image 169
John Lockwood Avatar answered Sep 22 '22 21:09

John Lockwood