gocv icon indicating copy to clipboard operation
gocv copied to clipboard

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 1

Open GothicFox opened this issue 5 years ago • 4 comments

i'm on macos sierra 10.12.6, and after i following the tuturials and run cmd: go run ./cmd/version/main.go, i got the following error message:

pkg-config --cflags -- 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 No package 'opencv' found pkg-config: exit status 1

so please help , thx!

Your Environment

  • Operating System and version:
  • OpenCV version used:3.4.3
  • How did you install OpenCV? brew install opencv
  • GoCV version used: newest 2018.11.28
  • Go version:go version go1.11.2 darwin/amd64
  • Did you run the env.sh or env.cmd script before trying to go run or go build? i put following into my ~/.bash_profile and sourced it:

export CGO_CXXFLAGS="--std=c++11" export CGO_CPPFLAGS="-I/usr/local/Cellar/opencv/3.4.3/include" export CGO_LDFLAGS="-L/usr/local/Cellar/opencv/3.4.3/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_photo -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_dnn -lopencv_plot -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ml -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_flann -lopencv_xobjdetect -lopencv_imgcodecs -lopencv_objdetect -lopencv_xphoto -lopencv_imgproc -lopencv_core"

GothicFox avatar Nov 28 '18 05:11 GothicFox