User forums > Using Code::Blocks
Get last error output
(1/1)
Overtaker:
Hello.
From time to time I struggle with error that just write a message to the console, and immediately close whole program.
My question is how to read such errors. I guess the easiest way would be to prevent console from closing, or by setting a breakpoint, but none of theese worked.
It would be good to redirect the console output to a file. How can such thing be done in Code::Blocks? Or if it can't, is there any other workaround, that would allow me to debug such errors? I'm working on Windows.
Thanks.
BlueHazzard:
sorry to say that to you, but this is not a c::b related question, but a general programming/debugging/output redirecting question...
so this question will probably be locked. Read the forum rules for more detail.
to give you a hint:
your program can (obviously) be started from outside c::b and so you can redirect the output to a file with the > command.
Overtaker:
I thought debugging is related to using code::blocks. Sorry if it's in wrong category.
And, oh my... I never thought of running it in simple cmd. Okay, thread can be closed. I look stupid now. :) Thank you.
Before the topic gets locked, is there any way of displaying exception messages, like the ones I mentioned in visual studio way, eg. a dialog message, or just anything output to code::blocks?
BlueHazzard:
What compiler? and what debugger? What exceptions (using throw?)?
I don't know how visual studio handles exceptions..
if you are using gdb you can try to make a tick under Settings->Debugger->Default->catch c++ exceptions
or you do it manually by typing a command in the "gdb command line". See http://www.delorie.com/gnu/docs/gdb/gdb_31.html
Navigation
[0] Message Index
Go to full version