所以我有这些代码行:
int maxY, maxX;
getmaxyx(stdscr, &maxY, &maxX);
Run Code Online (Sandbox Code Playgroud)
它给了我以下错误:
error C2440: '=' : cannot convert from 'int' to 'int *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Run Code Online (Sandbox Code Playgroud)
每次我使用它两次.我甚至没有使用=运算符!包含curses.h文件.我究竟做错了什么?
我想在我的一些程序中使用它而不是标准的IOStream.
此外,NCurses是否可以在Windows上运行,如果有的话,还是更好吗?
我正在Microsoft Visual C++ 10中编译我的程序,它使用PDCurses库.我已将其配置为与pdcurses.lib链接,但当我尝试运行该应用程序时,系统会抱怨它无法找到"pdcurses.dll".它不应该抱怨它.我曾经使用MinGW(GCC)编译程序,当我尝试运行应用程序时它并没有问我任何DLL.我能做些什么让MSVC静态链接PDCurses?
我希望使用 Rust 中名为“pancurses”的诅咒库开发一个跨平台 CUI,但我在 Windows 中遇到了一个奇怪的问题。由于某种原因,某些新的终端仿真器不是在当前终端仿真器(即 cmd)中运行 CUI,而是打开并运行 CUI,而 stdout 则定向到当前终端。例如,这与我在 python 中的 windows-curses 库中看到的不同,因此我怀疑这是 pancurses、pdcurses 或 rust 编译器中的某种配置选项,但我找不到任何文档这似乎相关。任何帮助表示赞赏。
编辑以包含最小可重现示例(使用 pancurses 0.17):
extern crate pancurses;
use pancurses::{initscr, noecho};
fn main() {
let window = initscr();
window.refresh();
window.keypad(true);
noecho();
window.getch();
}
Run Code Online (Sandbox Code Playgroud)