Name

pkg-config — Obtain compilation and linking flags for libraries

Synopsis

pkg-config [options] [libraries]

Examples

  • To get help on pkg-config

    pkg-config --help

  • To list all the compiling flags needed when compiling against gtk

    pkgconfig --cflags gtk+-2.0

  • To list all the linking flags needed when linking against gtk

    pkgconfig --libs gtk+-2.0

  • To compile and link a program against gtk

    gcc -Wall -g hello.c -o hello `pkg-config --cflags --libs gtk+-2.0`

  • To list all the libraries that pkg-config knows about

    pkgconfig --list-all