-1
#include <stdio.h>
#include <stdlib.h>
#include <curses.h>

int main(int argc, char *argv[]){
    move(12, 6);
    printf("hello world !");
    return 0;
}

The move function gives an error.

Jack Deeth
  • 3,062
  • 3
  • 24
  • 39
  • Welcome to StackOverflow! Please take the [tour], and read [ask], and use the formatting. To get help you'll need to include your intentions, your code, and the error or unexpected behaviour you're getting. – Jack Deeth Feb 17 '22 at 12:36
  • 1
    Does this answer your question? [How to use the move function under curses.h](https://stackoverflow.com/questions/51188836/how-to-use-the-move-function-under-curses-h) – 001 Feb 17 '22 at 12:39
  • I've edited your question somewhat to make the title more in line with expectations and to apply code formatting - please can you edit it further to include the exact error? – Jack Deeth Feb 17 '22 at 12:39
  • Does this answer your question? [C++ : Difference between linking library and adding include directories](https://stackoverflow.com/questions/7096152/c-difference-between-linking-library-and-adding-include-directories) – Thomas Dickey Feb 18 '22 at 09:15

1 Answers1

0

move returns an error (ERR is -1) because curses was not initialized, e.g., using initscr.

That printf will do nothing useful in curses; you should replace that with printw (and unless your program waits for input, e.g., by calling getch, will exit immediately).

The program also should call endwin (to undo the screen-initialization, making the terminal work properly).

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • Thank you for your help, i try what you Said but i still got the same error "Undefined symbols for architecture x86_64 "_initscr", referenced from: _main in curse-199ccd.o" – Jefferson Huxley Feb 18 '22 at 01:09