Having successfuly installed Curses and Curses::GUI, I wrote the following test code;
#!/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;
That produces the following error 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.
if you comment out initscr; you get an nearly identical message;
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.
Just as a check I compiled the following with;
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; }
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?

--hsm

"Never try to teach a pig to sing...it wastes your time and it annoys the pig."

In reply to Curses problem: initscr and endwin missing by hsmyers

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.