Search code examples
cabalcabal-install

How to tell Cabal where pkg-config packages are located?


Cabal fails to install ffmpeg-light. It gives the error:

cabal: The pkg-config package libavutil is required but it could not be found.
Failed to install ffmpeg-light-0.7.1.1
cabal: Error: some packages failed to install:
ffmpeg-light-0.7.1.1 failed during the configure step. The exception was:
ExitFailure 1

The pkg-config package is located at:

/home/timothy/ffmpeg_build/lib/pkgconfig

How do I tell Cabal where to look?


Solution

  • The PKG_CONFIG_PATH variable tells the system where to look for pkg-config packages. It can be set by: export PKG_CONFIG_PATH = /pkg-config-directory . In this example:

    export PKG_CONFIG_PATH=/home/timothy/ffmpeg_build/lib/pkgconfig