I have been building freerpd client for Eclipse in Ubuntu 14.04 but an error is popping up :

Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)

when I use CMake 2.8. How can I get rid of it?

  • 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.
    – dobey
    Jan 5 '16 at 17:27
  • eclipse is out of question as it is not involved in building, cmake-data is already there ,is there any possiblity that i can correct it with path environment ? Jan 5 '16 at 18:20
  • Does sudo apt-get install --reinstall pkg-config cmake-data help, in case any of their files were corrupted? Jan 5 '16 at 22:50


sudo apt-get install pkg-config
  • i tried that but no use Jan 5 '16 at 17:18
  • Did you also try sudo apt-get install cmake-data like dobey suggested? Jan 5 '16 at 17:58
  • yes , ananthu@ananthu-System-Product-Name:~/FreeRDP-masteropy$ sudo apt-get install cmake-data [sudo] password for ananthu: Reading package lists... Done Building dependency tree Reading state information... Done cmake-data is already the newest version. cmake-data set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 594 not upgraded. Jan 5 '16 at 18:13
  • but it is not solved then also Jan 5 '16 at 18:17

I ran into this nuts problem while compiling opencv. The problem is that CMake is not finding the pkg-config executable.

Fix like this:

1)In ubuntu terminal,

which pkg-config

You will get "usr/bin/pkg-config" if it's installed

2) Add

set(PKG_CONFIG_EXECUTABLE "/usr/bin/pkg-config")

to your Cmake file, or in your build directory, run "cmake-gui" to add it using the GUI. Now, Cmake will find the pkg-config.



SOLUTION that worked for me:

sudo apt-get install --reinstall pkg-config cmake-data

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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