g++ -Iinclude/ -Isrc/ -DOPENCVpkg-config --cflags opencv-DGPU -I/usr/local/cuda/include/ -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -c ./src/image_opencv.cpp -o obj/image_opencv.o
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containingopencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
./src/image_opencv.cpp:5:30: fatal error: opencv2/opencv.hpp: No such file or directory
compilation terminated.
Makefile:86: recipe for target 'obj/image_opencv.o' failed
my opencv=3.1.0 and cuda=9.0 ,who can help me? thanks
pkg-config --cflags opencv
run the command to check output like "-I/usr/.../opencv". If nothing, install opencv
@lihanhui 您好, 我可以说中文么? 我看你好像是北京的
最终sudo apt install libopencv-dev 解决
执行pkg-config --cflags opencv ,不报错。并且有显示那就说明没问题。
执行 echo pkg-config --libs --cflags opencv 有输出 ,也表示没问题
I resolved it using following steps:
Versions (other versions might also work):
Opencv: 4.2.0
No CUDA/CUDNN in use
Thank you.
Most helpful comment
最终sudo apt install libopencv-dev 解决