I
I
int02h2011-03-04 00:00:33
Mobile development
int02h, 2011-03-04 00:00:33

Problem with debugging console applications in Qt Creator

I create the simplest console application in Qt Creator:

#include <iostream>
int main(int argc, char *argv[])
{
    int n;
    std::cin >> n;
    return 0;
}


I put a breakpoint on the line with std::cin. I start debugging with F5. After making sure that the debugger stopped at the specified line, I press F10. After that, nothing happens, and the following message can be seen in the application console: &"warning: GDB: Failed to set controlling terminal: Invalid argument\n" . When you try to interrupt debugging, a window pops up with an error: "The gdb process ended unexpectedly (crash)" . On subsequent attempts to start debugging, the following errors appear: “The program is not being run” , and when debugging ends: “An error occurred while sending data to the Gdb process. For example, the process may no longer be running, or it may have closed its input channel.". With all these manipulations, the debugged process continues to hang in the list of processes. The problem is observed in 32-bit Ubuntu 10.10 and Windows 7. There is no such problem when developing UI applications.
Prompt, please, what is it can be and how with it or this to struggle?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
iidsp, 2011-03-05
@int02h

If I'm not mistaken, then nothing can be entered in cin in the creator's console. You need to run the application not by the creator, but really, and enter / debug!

B
BaJlepa, 2011-10-27
@BaJlepa

compare_asc and compare_desc must be static, when used this way

A
AxisPod, 2011-10-28
@AxisPod

www.cplusplus.com/reference/algorithm/sort/
You can use both a static function and a functor, if you want to use an object method, then it's already more difficult, but it's possible, for example, to use boost::bind.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question