开发者

Qt Creator 1.3.0 and problems with console

I've just installed Qt Creator 1.3.0 in Ubuntu 9.10. I want to use Qt Creator 1.3.0 to develop simple console applications like this:

#include <iostream>
using namespace std;

int main()
{
    int n, m;

    cout << "Enter numbers: ";

    cin >> n >> m;
    cout << n << " " << m;

    return 0;
}

It compile. When I run it, program prints "Enter numbers: ". I enter two numbers separated with space in Application Output, but application don't react on any开发者_运维知识库 number.

Plz, help me. How to use standard C++ console input in Qt Creator? I've tried to use 'Run in terminal' option, but it doesn't help.


The application output windows that you are probably referring to is exactly that, i.e. it does not allow any input. For console applications to allow input you need to check 'Run in terminal', which should open xterm.

If it does not or you want a different terminal emulator to be used, check the terminal settings in Options -> General.


Setting the absolute path to the xterm worked for me. See Console input with Qt Creator.

For me in Ubuntu, the Qt's default terminal only showed the output...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜