Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find pkg-config error

Tags:

linux

macos

I am trying to install some software on my mac; however I keep receiving the same error:

configure: error: The pkg-config script could not be found or is too old.  Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config.  Alternatively, you may set the environment variables XMEDCON_GLIB_CFLAGS and XMEDCON_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.  To get pkg-config, see <http://pkg-config.freedesktop.org/>. See `config.log' for more details 

I am not quite sure how to go about adding the pkg-config to the PATH. I have seen online (see link) that I should add the following:

Link showing how to direct PATH variable

export PATH=$PATH:/opt/local/bin     # Fixed typo as mentioned in comment 

which is where I have placed pkg-config. I still keep getting the error though every time I try to configure the files using ./configure. Any help would be super appreciated!

like image 932
Shinobii Avatar asked Apr 21 '14 17:04

Shinobii


People also ask

How do I find my pkg-config?

On a typical Unix system, it will search in the directories /usr/lib/pkgconfig and /usr/share/pkgconfig. This will usually cover system installed modules.

What is pkg-config Mac?

pkg-config is a helper tool used when compiling applications and libraries. It helps you insert the correct compiler options on the command line so an application can use gcc -o test test. c `pkg-config --libs --cflags glib-2.0` for instance, rather than hard-coding values on where to find glib (or other libraries).

Where is pkg-config in Ubuntu?

On most systems, pkg-config looks in /usr/lib/pkgconfig, /usr/share/pkgconfig, /usr/local/lib/pkgconfig and /usr/local/share/pkgconfig for these files.


1 Answers

For Ubuntu/Debian OS,

apt-get install -y pkg-config

For Redhat/Yum OS,

yum install -y pkgconfig

For Archlinux OS,

pacman -S pkgconf

like image 94
Stephen Hsu Avatar answered Sep 28 '22 04:09

Stephen Hsu