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

后端 未结 4 684
栀梦
栀梦 2020-12-06 19:20

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).

4条回答
  •  再見小時候
    2020-12-06 19:26

    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.

提交回复
热议问题