views:

575

answers:

3

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.

A: 

I'm going to look that one up. Meantime, have you looked at the TRACE macro and OutputDebugString?

John Lockwood
+1  A: 

Another approach, using files:

http://msdn.microsoft.com/en-us/library/aa236457%28VS.60%29.aspx

John Lockwood
Basically all you have to do is: guiapp.exe 2> stderr.log
Cristian Adam
+2  A: 

When you have a GUI process stderror should show up in the output window in visual studio. You can open a new console window if you want to have the output go there.look at the output. See my answer to this question. for details.

Byron Whitlock