Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

作者您好! 我在make的时候报错,找不到opencv2/opencv.cpp文件 #44

Open
jxuepeng opened this issue Jul 22, 2020 · 4 comments

Comments

@jxuepeng
Copy link

/media/hyzt/HYZT_Disk_3T/TensorRT-YOLOv4-master/src/../include/trt.h:13:30: fatal error: opencv2/opencv.hpp: No such file or directory
compilation terminated.
src/CMakeFiles/trt.dir/build.make:220: recipe for target 'src/CMakeFiles/trt.dir/trt.cpp.o' failed

@liudakai2
Copy link

在CMakeLists.txt里面加上 find_package( OpenCV x.x.x REQUIRED ) cmake会自动帮你找到你的版本的opencv库文件和头文件的

@jxuepeng
Copy link
Author

@liudakai2 加上这个还是不行 find_package(OpenCV 4 REQUIRED)

[ 81%] Linking CXX shared library ../../lib/libmynvonnxparser_runtime.so
[ 81%] Built target mynvonnxparser_runtime
[ 84%] Building NVCC (Device) object src/CMakeFiles/trt.dir/trt_generated_resize.cu.o
Scanning dependencies of target trt
[ 86%] Building CXX object src/CMakeFiles/trt.dir/trt.cpp.o
In file included from /home/hyzt/projects/TensorRT-YOLOv4-master/src/trt.cpp:5:0:
/home/hyzt/projects/TensorRT-YOLOv4-master/src/../include/trt.h:13:30: fatal error: opencv2/opencv.hpp: No such file or directory
compilation terminated.
src/CMakeFiles/trt.dir/build.make:89: recipe for target 'src/CMakeFiles/trt.dir/trt.cpp.o' failed
make[2]: *** [src/CMakeFiles/trt.dir/trt.cpp.o] Error 1
CMakeFiles/Makefile2:464: recipe for target 'src/CMakeFiles/trt.dir/all' failed
make[1]: *** [src/CMakeFiles/trt.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

还是报这个错误,找不到opencv2/opencv.hpp

@liudakai2
Copy link

liudakai2 commented Jul 27, 2020 via email

@jxuepeng
Copy link
Author

@liudakai2 我在cmake-gui里能看见opencv的路径, cmake也能过, 但是make的时候就是找不到oepncv.hpp,都好几天了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants