LinuxCommandLibrary

ncursesw5-config

Provide compiler and linker flags for ncursesw

SYNOPSIS

ncursesw5-config [OPTION...]

PARAMETERS

--prefix[=DIR]
    Displays or sets the installation prefix for the library.

--exec-prefix[=DIR]
    Displays or sets the installation prefix for executables.

--cflags
    Outputs the necessary preprocessor and compiler flags for building applications.

--libs
    Outputs the necessary linker flags and library paths for linking applications.

--version
    Displays the installed ncursesw5 library version.

--mouse-libs
    Outputs linker flags specifically for ncurses mouse support.

--termcap-libs
    Outputs linker flags for compatibility with the older termcap library.

--help
    Displays a help message with available options.

DESCRIPTION

ncursesw5-config is a specialized utility script designed to provide crucial configuration information about the installed ncursesw5 library on a Linux system. Its primary role is to assist build systems, such as configure scripts and Makefiles, in correctly compiling and linking applications that utilize the ncursesw5 library. By querying the system for accurate library paths, include paths, and specific linker flags, it eliminates the need for developers to hardcode these details, thereby enhancing the portability and reliability of software builds across diverse environments.
The 'w' suffix in ncursesw5 signifies comprehensive support for wide characters, essential for handling multi-byte character sets like Unicode (UTF-8). The '5' indicates that this utility specifically targets version 5 of the ncurses library, ensuring compatibility with that particular major release.

CAVEATS

This command is typically not invoked directly by end-users but rather by automated build systems (e.g., configure scripts, Makefiles) to abstract away platform-specific library configurations. Its output is highly dependent on the exact installation of the ncursesw5 library. On newer systems, ncursesw6-config or a more generic ncurses-config might be used.

TYPICAL USAGE IN BUILD SYSTEMS

ncursesw5-config is frequently embedded in build commands within Makefiles or shell scripts to automate compilation and linking. For instance, to compile a C program named myapp.c that uses ncursesw5, one might use:
gcc myapp.c $(ncursesw5-config --cflags --libs) -o myapp
This command dynamically retrieves the correct include paths and library linkage flags, ensuring that the application builds successfully across different environments without hardcoded paths.

HISTORY

The ncurses library (New Curses) is a widely used free software implementation of the System V Release 4.0 curses API, providing robust text-based user interface capabilities. The introduction of configuration scripts like ncursesw5-config standardized how applications discover and link against the library, replacing manual configuration. The 'w' suffix denotes the inclusion of wide-character support (Unicode/UTF-8), which became increasingly important for internationalization. Version 5 was a significant and widely adopted release, leading to dedicated configuration utilities to ensure compatibility and ease of development for applications targeting this specific version.

SEE ALSO

ncurses(3), ncurses-config(1), pkg-config(1)

Copied to clipboard