Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to use the Cygwin method for re-learning C using 21st Century C book by Ben Klemens. I've installed Cygwin and have been using Sage to install the packages mentioned in the book. The packages seem to install fine, I can call gcc, make, pkg-config, etc... but pkg-config can't seem to find anything. More specifically this cannot find anything:

$ pkg-config --libs gsl
$ pkg-config --cflags gsl

I've seen a couple questions that talk about changing the path. I've tried changing it to:

$ export PKG_CONFIG_PATH=c:\\cygwin\\usr\\local\\lib\\pkgconfig
$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
$ export PKG_CONFIG_PATH=C:\\cygwin\\bin

I also already have all of this installed:

  • binutils
  • gcc
  • gcc-core
  • gcc-g++
  • make
  • gdb
  • gsl

I verified they are installed using:

$ cygcheck -c | grep {string}

Admittedly, I'm not greatly familiar with Linux systems otherwise it'd be my main system and I'd not be using Cygwin ;)

share|improve this question
up vote 2 down vote accepted

I was setting the wrong path, I thought the export command was adding paths to the PKG_CONFIG_PATH variable, obviously I needed to prefix with the variable at the beginning (just like I'm supposed to do in Windows :) and separate with a colon if I really wanted to add paths

$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:{my_new_path}

But that wasn't the real problem of why pkg-config couldn't find gsl, even though I thought I installed the package, what I really needed to install was gsl-devel, and then it would add its .pc file to /lib/pkgconfig.

So to recap, I needed to use my package manager to install {package-name}-devel (gsl-devel), which would then add the relevant {package-name}.pc file (gsl.pc).

Set the variable correctly:

$ export PKG_CONFIG_PATH=/lib/pkgconfig

then get the development package:

$ apt-cyg install gsl-devel
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .