Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Eclipse 中添加了 PDCurses 库,当我运行我的程序时,出现此消息不支持重定向。
这是一个简单的代码,但我不相信这是我的代码中的错误。没有警告没有错误,只有控制台中的这条消息
#include <stdio.h> #include <curses.h> int main() { initscr(); printw("Hello World Curses"); refresh(); getch(); endwin(); return 0; }
您正在尝试使用 PDCurses 的 Win32 控制台版本,但您没有实际的控制台窗口(即 Windows 称之为控制台;有些人称之为 DOS 窗口)来运行它——显然,Eclipse 正在尝试将程序中的标准输入、标准输出和标准错误重定向到它自己的“控制台”窗口。这适用于简单的 stdio 内容,但 PDCurses 在较低级别操纵控制台——因此它不能以这种方式重定向其 I/O。
除了手动打开系统控制台窗口并从命令行调用程序之外,我不知道是否有适合您的解决方案。