/usr/bin/ld: cannot find -lopencv_imgcodecs
$ make
g++ -std=c++11 -O3 -I.. ../dlib/all/source.cpp -lpthread -lX11 -ljpeg -lpng -DDLIB_JPEG_SUPPORT -DDLIB_PNG_SUPPORT -c dnn_mmod_dog_hipsterizer_2.cpp
g++ -std=c++11 -O3 -I.. ../dlib/all/source.cpp -lpthread -lX11 -ljpeg -lpng -DDLIB_JPEG_SUPPORT -DDLIB_PNG_SUPPORT data.grpc.pb.o data.pb.o dnn_mmod_dog_hipsterizer_2.o -L/usr/local/lib -L/lib/x86_64-linux-gnu `pkg-config --libs grpc++ grpc` -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -lprotobuf -lpthread -ldl -lssl -ldlib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -o server
/usr/bin/ld: cannot find -lopencv_imgcodecs
collect2: error: ld returned 1 exit status
makefile:12: recipe for target 'server' failed
make: *** [server] Error 1
原來是 opencv_imgcodecs 是在 opencv 3.0+ 才有提供
安裝完 opencv 3.0+ 就可以編譯了。
參考 Ubuntu上安裝 OpenCV
http://peichengnote.blogspot.com/2018/01/ubuntu-build-and-install-opencv-on.html
ref
problem.. /usr/bin/ld: cannot find -lopencv_imgcodecs · Issue #4942 · BVLC/caffe https://github.com/BVLC/caffe/issues/4942
沒有留言:
張貼留言