make error : cannot find -lopencv
devhalfdog opened this issue · 3 comments
server@server:~/darknet$ pkg-config --modversion opencv4 4.1.2
opencv install 4.1.2
server@server:~/darknet$ make [ 0%] Linking CXX executable bindarknet /usr/bin/ld: cannot find -lopencv collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/bindarknet.dir/build.make:1149: bindarknet] error 1 make[1]: *** [CMakeFiles/Makefile2:80: CMakeFiles/bindarknet.dir/all] error 2 make: *** [Makefile:130: all] error 2
darknet make error ;(
server@server:~/darknet$ sudo ld -lopencv --verbose attempt to open /usr/local/lib/x86_64-linux-gnu/libopencv.so failed attempt to open /usr/local/lib/x86_64-linux-gnu/libopencv.a failed attempt to open /lib/x86_64-linux-gnu/libopencv.so failed attempt to open /lib/x86_64-linux-gnu/libopencv.a failed attempt to open /usr/lib/x86_64-linux-gnu/libopencv.so failed attempt to open /usr/lib/x86_64-linux-gnu/libopencv.a failed attempt to open /usr/lib/x86_64-linux-gnu64/libopencv.so failed attempt to open /usr/lib/x86_64-linux-gnu64/libopencv.a failed attempt to open /usr/local/lib64/libopencv.so failed attempt to open /usr/local/lib64/libopencv.a failed attempt to open /lib64/libopencv.so failed attempt to open /lib64/libopencv.a failed attempt to open /usr/lib64/libopencv.so failed attempt to open /usr/lib64/libopencv.a failed attempt to open /usr/local/lib/libopencv.so failed attempt to open /usr/local/lib/libopencv.a failed attempt to open /lib/libopencv.so failed attempt to open /lib/libopencv.a failed attempt to open /usr/lib/libopencv.so failed attempt to open /usr/lib/libopencv.a failed attempt to open /usr/x86_64-linux-gnu/lib64/libopencv.so failed attempt to open /usr/x86_64-linux-gnu/lib64/libopencv.a failed attempt to open /usr/x86_64-linux-gnu/lib/libopencv.so failed attempt to open /usr/x86_64-linux-gnu/lib/libopencv.a failed ld: cannot find -lopencv
cannot find libopencv.so
server@server:/usr/local/lib$ find . -name "libopencv*" ./libopencv_imgcodecs.so ./libopencv_freetype.so ./libopencv_bioinspired.so ./libopencv_core.so.4.1 ./libopencv_dpm.so.4.1 ./libopencv_bgsegm.so.4.1.2 ./libopencv_gapi.so ./libopencv_rgbd.so ./libopencv_structured_light.so ./libopencv_features2d.so ./libopencv_phase_unwrapping.so.4.1 ./libopencv_photo.so.4.1.2 ./libopencv_saliency.so ./libopencv_stitching.so ./libopencv_face.so.4.1 ./libopencv_xfeatures2d.so.4.1.2 ./libopencv_highgui.so.4.1 ./libopencv_bioinspired.so.4.1.2 ./libopencv_shape.so.4.1.2 ./libopencv_rgbd.so.4.1.2 ./libopencv_flann.so.4.1.2 ./libopencv_ml.so.4.1 ./libopencv_dnn_superres.so ./libopencv_videoio.so ./libopencv_flann.so ./libopencv_text.so.4.1 ./libopencv_videostab.so ./libopencv_dpm.so.4.1.2 ./libopencv_surface_matching.so ./libopencv_dnn.so.4.1 ./libopencv_img_hash.so.4.1 ./libopencv_highgui.so.4.1.2 ./libopencv_reg.so.4.1.2 ./libopencv_videostab.so.4.1 ./libopencv_features2d.so.4.1 ./libopencv_bioinspired.so.4.1 ./libopencv_freetype.so.4.1 ./libopencv_dnn_superres.so.4.1.2 ./libopencv_shape.so ./libopencv_superres.so ./libopencv_core.so ./libopencv_xphoto.so.4.1.2 ./libopencv_video.so ./libopencv_img_hash.so.4.1.2 ./libopencv_ml.so.4.1.2 ./libopencv_bgsegm.so ./libopencv_core.so.4.1.2 ./libopencv_imgproc.so ./libopencv_optflow.so.4.1 ./libopencv_objdetect.so.4.1.2 ./libopencv_ximgproc.so.4.1 ./libopencv_stitching.so.4.1.2 ./libopencv_line_descriptor.so.4.1.2 ./libopencv_dnn_objdetect.so.4.1 ./libopencv_face.so ./libopencv_flann.so.4.1 ./libopencv_videoio.so.4.1.2 ./libopencv_xobjdetect.so.4.1.2 ./libopencv_videostab.so.4.1.2 ./libopencv_gapi.so.4.1 ./libopencv_plot.so.4.1 ./libopencv_face.so.4.1.2 ./libopencv_ccalib.so.4.1.2 ./libopencv_optflow.so ./libopencv_structured_light.so.4.1.2 ./libopencv_line_descriptor.so ./libopencv_superres.so.4.1 ./libopencv_ml.so ./libopencv_shape.so.4.1 ./libopencv_saliency.so.4.1 ./libopencv_bgsegm.so.4.1 ./libopencv_quality.so ./libopencv_ximgproc.so ./libopencv_aruco.so ./libopencv_text.so.4.1.2 ./libopencv_fuzzy.so.4.1 ./libopencv_dnn_objdetect.so ./libopencv_text.so ./libopencv_datasets.so ./libopencv_plot.so ./libopencv_calib3d.so.4.1.2 ./libopencv_surface_matching.so.4.1.2 ./libopencv_phase_unwrapping.so.4.1.2 ./libopencv_imgcodecs.so.4.1.2 ./libopencv_freetype.so.4.1.2 ./libopencv_dpm.so ./libopencv_imgproc.so.4.1 ./libopencv_phase_unwrapping.so ./libopencv_ccalib.so ./libopencv_xphoto.so ./libopencv_img_hash.so ./libopencv_features2d.so.4.1.2 ./libopencv_imgproc.so.4.1.2 ./libopencv_stereo.so.4.1 ./libopencv_tracking.so ./libopencv_tracking.so.4.1.2 ./libopencv_hfs.so.4.1.2 ./libopencv_dnn.so ./libopencv_calib3d.so ./libopencv_imgcodecs.so.4.1 ./libopencv_reg.so ./libopencv_xfeatures2d.so.4.1 ./libopencv_photo.so.4.1 ./libopencv_hfs.so.4.1 ./libopencv_rgbd.so.4.1 ./libopencv_optflow.so.4.1.2 ./libopencv_objdetect.so.4.1 ./libopencv_tracking.so.4.1 ./libopencv_xobjdetect.so.4.1 ./libopencv_hfs.so ./libopencv_stitching.so.4.1 ./libopencv_stereo.so.4.1.2 ./libopencv_objdetect.so ./libopencv_highgui.so ./libopencv_plot.so.4.1.2 ./libopencv_aruco.so.4.1 ./libopencv_videoio.so.4.1 ./libopencv_quality.so.4.1 ./libopencv_surface_matching.so.4.1 ./libopencv_dnn_superres.so.4.1 ./libopencv_reg.so.4.1 ./libopencv_datasets.so.4.1.2 ./libopencv_ccalib.so.4.1 ./libopencv_quality.so.4.1.2 ./libopencv_xobjdetect.so ./libopencv_dnn.so.4.1.2 ./libopencv_dnn_objdetect.so.4.1.2 ./libopencv_xphoto.so.4.1 ./libopencv_photo.so ./libopencv_line_descriptor.so.4.1 ./libopencv_saliency.so.4.1.2 ./libopencv_calib3d.so.4.1 ./libopencv_aruco.so.4.1.2 ./libopencv_fuzzy.so ./libopencv_datasets.so.4.1 ./libopencv_gapi.so.4.1.2 ./libopencv_xfeatures2d.so ./libopencv_stereo.so ./libopencv_video.so.4.1 ./libopencv_structured_light.so.4.1 ./libopencv_fuzzy.so.4.1.2 ./libopencv_ximgproc.so.4.1.2 ./libopencv_superres.so.4.1.2 ./libopencv_video.so.4.1.2
cannot find libopencv.so and libopencv.a
how to solve it
hmm... have you looked at this repository on auto-build scripts? please provide os name and version and some more details if you can, I do not need console outputs, just messages and conclusions should allow solving the issue :). the advice looks on CMake instead of making as an option to build. thanks for this issue, making this solution better :).
@sowson
Ubuntu version 20.04
Kernel 5.11.0-38-generic
When I was using Ubuntu Kernel 5.4.. version, it worked fine.
Ah I haven't installed OpenCL right now.
To turn to the cpu.
And use cmake .
Command good worked.
make
command not worked
`src/network.c:444
waring implicit declaration of function 'opencl_push_array'
Error: 'network' {aka 'struct network'} has no member named 'output_gpu'; did you mean 'output'?`
Sorry i use google transition
should be fine with the last commit, thanks!