Package opencv was not found in the pkg-config search path

package 'openssl was not found in the pkg-config search path
package 'protobuf was not found in the pkg-config search path
package gnutls was not found in the pkg-config search path
project error: opencv development package not found
package 'nss was not found in the pkg-config search path
package libftdi1 was not found in the pkg config search path
package 'libpcre was not found in the pkg-config search path
package zlib was not found in the pkg-config search path

I have installed OpenCV using the instructions in https://help.ubuntu.com/community/OpenCV

$ sudo su
$ sudo apt-get install build-essential
$ sudo apt-get install libavformat-dev
$ sudo apt-get install ffmpeg
$ sudo apt-get install libcv2.3 libcvaux2.3 libhighgui2.3 python-opencv opencv-doc libcv-dev libcvaux-dev libhighgui-dev

now when i execute "pkg-config --cflags --libs opencv" i get this error:

Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found

how can I resolve this problem?

-------UPDATE-------

OK, I figured out how to solve the problem...

I made a file named "opencv.pc" and copied it to "/usr/local/lib/pkgconfig" Then i added these two lines to ".bashrc":

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH

that's it! everything is OK now.

the contents of the file are:

prefix=/usr
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib

Name: opencv
Description: The opencv library
Version: 2.x.x
Cflags: -I${includedir}/opencv -I${includedir}/opencv2
Libs: -L${libdir} -lopencv_calib3d -lopencv_imgproc -lopencv_contrib -lopencv_legacy -lopencv_core -lopencv_ml -lopencv_features2d -lopencv_objdetect -lopencv_flann -lopencv_video -lopencv_highgui

UPDATE - 2014

it seems that the ubuntu community has completed the documentation on installing openCV, all you have to do now is to download the installation script from https://github.com/jayrambhia/Install-OpenCV/blob/master/Ubuntu/opencv_latest.sh and execute it.


From your question I guess you are using Ubuntu (or a derivate). If you use:

apt-file search opencv.pc

then you see that you have to install libopencv-dev.

After you do so, pkg-config --cflags opencv and pkg-config --libs opencv should work as expected.

Package opencv was not found in the pkg-config search path. · Issue , Package opencv was not found in the pkg-config search path. #57. Closed. jabrena opened this issue on Sep 20, 2015 · 22 comments. Closed  Package opencv was not found in the pkg-config search path From your question I guess you are using Ubuntu (or a derivate).If you use:apt-file search opencv.pcthen you see that you have to install lib opencv -dev. After you do so, pkg-config --cflags open


Package opencv was not found in the pkg-config search path , Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found pkg-​config: exit status  g++ -c testOpenCV.cpp -Wall `pkg-config opencv --cflags` (attention: les apostrophes sont faites avec AltGr + 7) et là, c'est le drame: Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing 'opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found


it seems that the ubuntu community has completed the documentation on installing openCV,

so all you have to do now is to download the installation script from here and execute it.

don't forget to make it executable:

chmod +x opencv_latest.sh

then

./opencv_latest.sh

Package OpenCV not found? Let's Find It., Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the  I am compiling the darknet for the opencv support. It is the output I get from the make: ++ -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv` -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -c ./src/image_opencv.cpp -o obj/image_opencv.o Package opencv was not found in the pkg-config search path.


I got the same error when trying to compile a Go package on Debian 9.8:

# pkg-config --cflags  -- libssl libcrypto
Package libssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libssl.pc'

The thing is that pkg-config searches for package meta-information in .pc files. Such files come from the dev package. So, even though I had libssl installed, I still got the error. It was resolved by running:

sudo apt-get install libssl-dev

software installation - how do I install opencv4.0 on 18.10?, pkg-config --cflags opencv Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing  Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found how can I resolve this problem?


Hi first of all i would like you to use 'Synaptic Package Manager'. You just need to goto the ubuntu software center and search for synaptic package manager.. The beauty of this is that all the packages you need are easily available here. Second it will automatically configures all your paths. Now install this then search for opencv packages over there if you found the package with the green box then its installed but else the package is not in the right place so you need to reinstall it but from package manager this time. If installed then you can do this only, you just need to fill the OpenCV_DIR variable with the path of opencv (containing the OpenCVConfig.cmake file)

    export OpenCV_DIR=<path_of_opencv>

unable to find opencv through pkg-config --cflags opencv, this path PKG_CONFIG_PATH=/usr/local/lib/pkg-config to bashrc file. i says Package opencv was not found in the pkg-config search path. Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable


Opencv installation is not in the pkg-config search path, Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the  ↪ pkg-config --cflags --libs opencv Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable Package 'opencv', required by 'virtual:world', not found ↪ so it leading to fatal error #include in compile time


Use pkg-config with Homebrew installed software, Get code examples like "Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing 


package opencv was not found in the pkg-config search path for , Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH