# pkg-config

7 Hacker News commenters recommended pkg-config and 1 criticized it, November 2025 to November 2026. It was recommended in 6 of 13 months.

**Verdict:** People recommend it for generating compiler and linker flags for installed libraries, which simplifies adding C libraries to projects and Makefiles. One critic says it is comparing apples to oranges.

## Why people recommend it

- Generates library compile and link flags (2 comments): "Especially with tools like pkg-config that let you generate the set of flags for a package." ([source](https://news.ycombinator.com/item?id=48070192)) "I never found it hard to add a C library to my projects using pkg-config." ([source](https://news.ycombinator.com/item?id=45783325))
- Simplifies library handling in Makefiles (2 comments): "Especially with tools like pkg-config that let you generate the set of flags for a package." ([source](https://news.ycombinator.com/item?id=48070192)) "you can add a bit of syntactic sugar to your Makefile and have that mostly handled for you" ([source](https://news.ycombinator.com/item?id=46047352))

## Alternatives hackers recommend

- [Bazel](https://hackerapproved.com/p/bazel.md): 79 recommend
- [GNU Make](https://hackerapproved.com/p/gnu-make.md): 76 recommend
- [CMake](https://hackerapproved.com/p/cmake.md): 58 recommend
- [Apache Maven](https://hackerapproved.com/p/maven.md): 44 recommend
- [Ninja build system](https://hackerapproved.com/p/ninja.md): 37 recommend

## Cite as

Hacker Approved, "pkg-config", https://hackerapproved.com/p/pkg-config/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
