Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c

ncurses

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!

like image 404
mutenewt Avatar asked Oct 05 '09 00:10

mutenewt


People also ask

What is the difference between curses and ncurses?

Curses is the name of the original library from SystemV. NCurses is an open source implementation of the library, with the same API. Every implementation will provide their specific header, like ncurses.

What is ncurses libs?

ncurses-libs - Ncurses libraries The curses library routines are a terminal-independent method of updating character screens with reasonable optimization. The ncurses (new curses) library is a freely distributable replacement for the discontinued 4.4 BSD classic curses library.

What are ncurses in C?

ncurses (new curses) is a programming library providing an application programming interface (API) that allows the programmer to write text-based user interfaces (TUI) in a terminal-independent manner. It is a toolkit for developing "GUI-like" application software that runs under a terminal emulator.

Why is it called ncurses?

ncurses (new curses, pronounced "enn-curses") started as a freely distributable “clone” of System V Release 4.0 (SVr4) curses. It has outgrown the “clone” description, and now contains many features which are not in SVr4 curses. Curses is a pun on the term “cursor optimization”.


1 Answers

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.

like image 194
goldPseudo Avatar answered Sep 20 '22 23:09

goldPseudo