简体   繁体   中英

C++ console ncurses project - QtCreator doesn't show any output in xterm neither in console

#include <ncurses.h>

int main()
{
    initscr();

    addstr("Hello world");
    refresh();
    getch();
    endwin();
    return 0;
}

This basic application doesn't show any output when building and running in QtCreator 2.8.0.

When i run previously compiled in QtCreator program in separate terminal window, then it works fine. But when i run it under QtCreator (Ctrl-R or press "Run" button), then i see empty xterm window and no output. I guess this is somehow related with qtcreator_process_stub , which entitles that empty xterm window.

Try replacing

addstr("Hello world");

with

printw("Hello World !!!");

see

Found a solution.

In Project settings -> Environment -> TERM variable should be set to sane value like xterm

By default it was set to dumb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM