I am trying to compile some code that uses curses to clear the screen, on my personal machine (Debian sid) it works, but in Cygwin and a Ubuntu 14.04 VM it doesn't compile. I have tried using both -lcurses and -lncurses, and I'm including ncurses.h in the program, even with these, it gives me the following error:
1 2 3 4 5 6 7
g++ -std=c++11 -g -Wall -lncurses -fpermissive -O2 main.o turn.o clearscreen.o endcheck.o parse.o randevents.o -o CWS
clearscreen.o: In function `clearScreen()':
/home/czar/Downloads/CWS/clearscreen.cpp:9: undefined reference to `cur_term'
/home/czar/Downloads/CWS/clearscreen.cpp:18: undefined reference to `tigetstr'
/home/czar/Downloads/CWS/clearscreen.cpp:18: undefined reference to `putp'
/home/czar/Downloads/CWS/clearscreen.cpp:12: undefined reference to `setupterm'
cmiiw, I think that the order matters if you are using an static library, and in that case the one that needs the symbols should appear before the one that defines them.