编译opencv执行程序时,找不到静态库

g++ example.o -o opencv_example -L/usr/local/lib -lopencv_cudabgsegm -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_stitching -lopencv_cudafeatures2d -lopencv_superres -lopencv_cudacodec -lopencv_videostab -lopencv_cudaoptflow -lopencv_cudalegacy -lopencv_cudawarping -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_cvv -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -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_text -lopencv_dnn -lopencv_plot -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ml -lopencv_ximgproc -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_imgproc -lopencv_cudaarithm -lopencv_core -lopencv_cudev -lm -lpthread -lGL -lGLU -lcudart_static -ldl -lrt -lnppc -lnppial -lnppicc -lnppicom -lnppidei -lnppif -lnppig -lnppim -lnppist -lnppisu -lnppitc -lnpps -lcublas -lcufft
/usr/bin/ld: cannot find -lcudart_static
/usr/bin/ld: cannot find -lnppc
/usr/bin/ld: cannot find -lnppial
/usr/bin/ld: cannot find -lnppicc
/usr/bin/ld: cannot find -lnppicom
/usr/bin/ld: cannot find -lnppidei
/usr/bin/ld: cannot find -lnppif
/usr/bin/ld: cannot find -lnppig
/usr/bin/ld: cannot find -lnppim
/usr/bin/ld: cannot find -lnppist
/usr/bin/ld: cannot find -lnppisu
/usr/bin/ld: cannot find -lnppitc
/usr/bin/ld: cannot find -lnpps
/usr/bin/ld: cannot find -lcublas
/usr/bin/ld: cannot find -lcufft
collect2: error: ld returned 1 exit status
Makefile:9: recipe for target 'opencv_example' failed
make: *** [opencv_example] Error 1

 

原因/usr/local/lib/pkgconfig/opencv.pc有错误,

静态参数      -L-L/usr/local/cuda-10.0 -llib64 -L-L/usr/lib -laarch64-linux-gnu

修改为

Libs.private: -lm -lpthread -lGL -lGLU -lcudart_static -ldl -lrt -lnppc -lnppial -lnppicc -lnppicom -lnppidei -lnppif -lnppig -lnppim -lnppist -lnppisu -lnppitc -lnpps -lcublas -lcufft -L/usr/local/cuda-10.0/lib64 -L/usr/lib/aarch64-linux-gnu

 

 

你可能感兴趣的:(编译opencv执行程序时,找不到静态库)