Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mac error: pkg-config not found (even if pkg-config is already installed)

Tags:

package

admin

I have read several posts about this.
But they didn't solved from mine.

Please see the information

brew install pkg-config

Finish install then

Rangers-iMac:dash ranger$ which pkg-config
/usr/local/bin/pkg-config

It means pkg-config is installed.

Rangers-iMac:dash ranger$ ./configure
...
checking for exit in -lboost_chrono-mt... yes
checking whether the Boost::Unit_Test_Framework library is available... yes
checking for dynamic linked boost test... yes
configure: error: pkg-config not found.

it means configure can't find pkg-config.

I think the problem is in PATH, but I can't figure out how to fix it.

like image 878
artgb Avatar asked Oct 18 '17 14:10

artgb


People also ask

Can not find pkg-config?

You are either missing the cmake-data package, have managed to delete some files it contains, or Eclipse is using a different cmake than comes in Ubuntu, or is messing with the default modules path environment of cmake.

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).

How do I find my pkg-config?

By default, pkg-config looks in the directory prefix/lib/pkgconfig for these files; it will also look in the colon-separated (on Windows, semicolon-separated) list of directories specified by the PKG_CONFIG_PATH environment variable.


1 Answers

The project's configure-script seems to make assumptions about the location of pkg-config. Luckily you can override it using the PKG_CONFIG environment variable.

export PKG_CONFIG=/path/to/pkg-config

Then ./configure again.

like image 124
deets Avatar answered Sep 18 '22 11:09

deets