What's the difference between -lcurses and -lncurses when compiling C using ncurses lib?

mutenewt picture mutenewt · Oct 5, 2009 · Viewed 12k times · Source

I'm learning C and playing with the ncurses lib. I have seen references to both -lcurses and -lncurses but I have yet to find any differences (both work when compiling).

Appreciate the help!

Answer

goldPseudo picture goldPseudo · Oct 5, 2009

ncurses is an open-source clone of the original Unix curses library. libcurses.* usually points to libncurses.* to provide compatibility with the original library, so there would be no practical difference between using one over the other.

If you do in fact have more than one 'curses-type' library installed, -lcurses would essentially link your program to the default one, whereas -lncurses would explicitly choose the ncurses implementation.