I'm writing a terminal based Tetris game using ncurses. I've segregated all of the ncurses code into a file called tetrisUI.c which i include a header file for in my main.c source file. When I compile all of the ncurses functions raise compiler errors. I have included ncurses.h in my source file and I'm using the -lncurses flag in gcc. I'm compiling from a makefile with the following contents:
Tetris : tetris.o main.o tetrisUI.o
gcc tetris.o main.o tetrisUI.o -o Tetris
tetrisUI.o : tetrisUI.c
gcc -std=c99 -c tetrisUI.c -lncurses
tetris.o : tetris.c tetris.h
gcc -std=c99 -c tetris.c
main.o : main.c tetris.h tetrisUI.h
gcc -std=c99 -c main.c
I was able to compile a few short test programs using ncurses just fine. This is my first attempt at using ncurses and my first significant c program (I've done a little c++ in school). I have a hunch that my problem has something to do with my makefile but I'm a noob at using those too.