Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 apt-cyg 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

1 Answer 1

up vote 1 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.