c++ - What's wrong with my code? (pdcurses/getmaxyx) -


This gives me an access violation on the getmaxyx line (the second row in the main job) and gives me two warnings:

  Link: Warning LNK 4049: Locally defined symbol "_stdscr" imported link: Warning LNK 4049: Locally defined symbol "_sp" imported  

  #include & lt; Time.h> # Include & lt; Curses.h & gt; #include "Ball.h" #include "Paddle.h" #include "config.h" int main (int argc, char * argv []) {int maxy, maxx; Getmaxx (STSCR, max, max); Pedal * pedal lift = new pedal (0, key_l_up, key_la_down); Pedal * paddlelight = new pedal (maxx, key_r_up, key_r_eded); Ball * ball = new ball (pedal left, paddle right); Int key = 0; Initscr (); Cbreak (); Noecho (); Curs_set (0); While (key! = KEY_QUIT) {key = getch (); PaddleLeft-> OnKeyPress (key); PaddleRight-> OnKeyPress (key); } Andwin (); Return 0; }  

It has been a long time since using my curse, but I think you need to make calls like initscr () any other curse like getmaxyx

In addition, you probably are missing some error checks on the return of initscr and return values ​​are needed to be properly used (you may be able to pass it on to another cursor method. Will happen? ).


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -