hsmyers has asked for the wisdom of the Perl Monks concerning the following question:
That produces the following error message;#!/usr/bin/perl # test.pl -- use Modern::Perl '2020'; use utf8; no if $] >= 5.018, warnings => "experimental"; use open ':std', ':encoding(UTF-8)'; use autodie; use Curses; initscr; endwin;
if you comment out initscr; you get an nearly identical message;C:\Users\hsmyers\perl\two>test Curses function 'initscr' is not defined in your Curses library at C:\ +Users\hsmyers\perl\two\test.pl line 10.
Just as a check I compiled the following with;C:\Users\hsmyers\perl\two>test Curses function 'endwin' is not defined in your Curses library at C:\U +sers\hsmyers\perl\two\test.pl line 11.
As I thought, it ran without a problem. This, in my mind, suggests that the successful installation of curses.pm, wasn't. All of this is in Windows 10, the most problematic perl playground. Since I've already done a great deal of coding using WSL/Ubuntu, I know that the same module has no problem in 'nix, just Windows. Does anyone have any suggestions?gcc curhello.c -lcurses #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <curses.h> int main(void) { WINDOW * mainwin; if ( (mainwin = initscr()) == NULL ) { fprintf(stderr, "Error initialising ncurses.\n"); exit(EXIT_FAILURE); } mvaddstr(13, 33, "Hello, world!"); refresh(); sleep(3); delwin(mainwin); endwin(); refresh(); return EXIT_SUCCESS; }
--hsm
"Never try to teach a pig to sing...it wastes your time and it annoys the pig."
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Curses problem: initscr and endwin missing
by aitap (Curate) on Feb 18, 2021 at 19:44 UTC | |
by hsmyers (Canon) on Feb 18, 2021 at 20:18 UTC | |
by Anonymous Monk on Feb 22, 2021 at 13:54 UTC | |
by hsmyers (Canon) on Feb 22, 2021 at 21:37 UTC |