Check out example codes for "gcc undefined reference to initscr'". It will help you in understanding the concepts better.

Code Example 1

gcc -W -Wall -Werror -Wextra -I./Includes/. -o Sources/NCurses/ncurses_init.o -c Sources/NCurses/ncurses_init.c -lncurses

Learn ReactJs, React Native from akashmittal.com